| Safe Haskell | None |
|---|---|
| Language | GHC2024 |
NanoUI.Input
Description
The per-frame Input record backends fill in: pointer state, keys and
modifiers, typed characters, scroll, window size, and file drops.
Synopsis
- data Key
- data Modifiers = Modifiers {}
- data Input = Input {
- inputMousePos :: !V2
- inputMouseDown :: !Bool
- inputMousePressed :: !Bool
- inputMouseReleased :: !Bool
- inputMouseRightDown :: !Bool
- inputMouseRightPressed :: !Bool
- inputMouseRightReleased :: !Bool
- inputMouseClicks :: !Int
- inputScroll :: !V2
- inputKeys :: SmallArray Key
- inputChars :: !Text
- inputModifiers :: !Modifiers
- inputWindowSize :: !Size
- inputDeltaTime :: !Float
- inputDrops :: SmallArray DropEvent
- inputWindowRedraw :: !Bool
- data DropType
- data DropEvent = DropEvent {
- dropEventType :: !DropType
- dropEventPos :: !(Maybe V2)
- dropEventData :: !Text
- emptyDropEvents :: SmallArray DropEvent
- emptyInput :: Input
- inputInteracted :: Input -> Input -> Bool
- inputPointerHeld :: Input -> Bool
- appendInputKey :: Key -> SmallArray Key -> SmallArray Key
- appendDropEvent :: DropEvent -> SmallArray DropEvent -> SmallArray DropEvent
- data MouseButton
- applyMouseButton :: MouseButton -> Bool -> Input -> Input
- inputKeysNull :: SmallArray Key -> Bool
- inputKeysElem :: Key -> SmallArray Key -> Bool
- foldInputKeys :: (a -> Key -> a) -> a -> SmallArray Key -> a
- inputKeysFromList :: [Key] -> SmallArray Key
- emptyInputKeys :: SmallArray Key
- stripInteractionInput :: Input -> Input
- data UiCursorKind
- grabHoverKind :: Bool -> Input -> UiCursorKind
- grabDragKind :: Bool -> Bool -> Input -> UiCursorKind
- clearEphemeral :: Input -> Input
- isHardQuitInput :: Input -> Bool
- splitFrame :: (a -> Bool) -> [a] -> ([a], [a])
Documentation
Constructors
| KeyBackspace | |
| KeyDelete | |
| KeyEnter | |
| KeyEscape | |
| KeyTab | |
| KeyLeft | |
| KeyRight | |
| KeyUp | |
| KeyDown | |
| KeyHome | |
| KeyEnd |
Instances
Constructors
| Input | |
Fields
| |
OS-level drag-and-drop event kind, mirroring SDL_EventType drop codes.
Constructors
| DropBegin | A drag enters the window; no position or payload yet. |
| DropPosition | The drag pointer moved over the window; position available. |
| DropFile | A file path was dropped; |
| DropText | Text was dropped; |
| DropComplete | The OS drag operation finished. |
A single normalized drop payload surfaced to widgets.
Constructors
| DropEvent | |
Fields
| |
Instances
emptyInput :: Input Source #
inputPointerHeld :: Input -> Bool Source #
appendInputKey :: Key -> SmallArray Key -> SmallArray Key Source #
appendDropEvent :: DropEvent -> SmallArray DropEvent -> SmallArray DropEvent Source #
The drops with one more at the end.
data MouseButton Source #
Mouse buttons tracked by Input.
Constructors
| MouseLeft | |
| MouseRight |
Instances
| Eq MouseButton Source # | |
Defined in NanoUI.Input | |
| Show MouseButton Source # | |
Defined in NanoUI.Input Methods showsPrec :: Int -> MouseButton -> ShowS # show :: MouseButton -> String # showList :: [MouseButton] -> ShowS # | |
applyMouseButton :: MouseButton -> Bool -> Input -> Input Source #
Apply a button transition: the held state plus that frame's one-shot pressed or released flag.
inputKeysNull :: SmallArray Key -> Bool Source #
inputKeysElem :: Key -> SmallArray Key -> Bool Source #
foldInputKeys :: (a -> Key -> a) -> a -> SmallArray Key -> a Source #
inputKeysFromList :: [Key] -> SmallArray Key Source #
stripInteractionInput :: Input -> Input Source #
data UiCursorKind Source #
Constructors
| UiCursorDefault | |
| UiCursorPointer | |
| UiCursorText | |
| UiCursorGrab | |
| UiCursorGrabbing | |
| UiCursorNsResize | |
| UiCursorEwResize | |
| UiCursorNwseResize | |
| UiCursorNeswResize |
Instances
| Eq UiCursorKind Source # | |
Defined in NanoUI.Input | |
| Show UiCursorKind Source # | |
Defined in NanoUI.Input Methods showsPrec :: Int -> UiCursorKind -> ShowS # show :: UiCursorKind -> String # showList :: [UiCursorKind] -> ShowS # | |
grabHoverKind :: Bool -> Input -> UiCursorKind Source #
grabDragKind :: Bool -> Bool -> Input -> UiCursorKind Source #
clearEphemeral :: Input -> Input Source #
isHardQuitInput :: Input -> Bool Source #
splitFrame :: (a -> Bool) -> [a] -> ([a], [a]) Source #