nano-ui
Safe HaskellNone
LanguageGHC2024

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

Documentation

data Key Source #

Instances

Instances details
Eq Key Source # 
Instance details

Defined in NanoUI.Input

Methods

(==) :: Key -> Key -> Bool #

(/=) :: Key -> Key -> Bool #

Bounded Key Source # 
Instance details

Defined in NanoUI.Input

Methods

minBound :: Key #

maxBound :: Key #

Enum Key Source # 
Instance details

Defined in NanoUI.Input

Methods

succ :: Key -> Key #

pred :: Key -> Key #

toEnum :: Int -> Key #

fromEnum :: Key -> Int #

enumFrom :: Key -> [Key] #

enumFromThen :: Key -> Key -> [Key] #

enumFromTo :: Key -> Key -> [Key] #

enumFromThenTo :: Key -> Key -> Key -> [Key] #

Show Key Source # 
Instance details

Defined in NanoUI.Input

Methods

showsPrec :: Int -> Key -> ShowS #

show :: Key -> String #

showList :: [Key] -> ShowS #

data Modifiers Source #

Constructors

Modifiers 

Fields

Instances

Instances details
Eq Modifiers Source # 
Instance details

Defined in NanoUI.Input

Show Modifiers Source # 
Instance details

Defined in NanoUI.Input

data DropType Source #

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; dropEventData holds the path.

DropText

Text was dropped; dropEventData holds the text.

DropComplete

The OS drag operation finished.

Instances

Instances details
Eq DropType Source # 
Instance details

Defined in NanoUI.Input

Show DropType Source # 
Instance details

Defined in NanoUI.Input

data DropEvent Source #

A single normalized drop payload surfaced to widgets.

Constructors

DropEvent 

Instances

Instances details
Eq DropEvent Source # 
Instance details

Defined in NanoUI.Input

Show DropEvent Source # 
Instance details

Defined in NanoUI.Input

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

Instances details
Eq MouseButton Source # 
Instance details

Defined in NanoUI.Input

Show MouseButton Source # 
Instance details

Defined in NanoUI.Input

applyMouseButton :: MouseButton -> Bool -> Input -> Input Source #

Apply a button transition: the held state plus that frame's one-shot pressed or released flag.

foldInputKeys :: (a -> Key -> a) -> a -> SmallArray Key -> a Source #

splitFrame :: (a -> Bool) -> [a] -> ([a], [a]) Source #