x11-xinput- Haskell FFI bindings for X11 XInput library (-lXi)

Safe HaskellNone



This module contains some higher-level functions, - wrapping XInput calls. #



xinputInit :: Display -> IO XInputInitResultSource

Initialize XInput 2.0 extension.

xinputCheckVersion :: Display -> IO (Maybe (Int, Int))Source

Returns Nothing if XInput 2.0 is supported, or Just (major, minor) if another version is supported



:: MonadIO m 
=> Display 
-> Opcode

Extension identifier (one got from xinputInit)

-> XEventPtr

Pointer to X11 event

-> (Event -> m a)

Handler for usual X11 event

-> (EventCookie -> m a)

Handler for X11 cookie event

-> m a 

Handle usual X11 event or cookie event.

eventButton :: Event -> Maybe IntSource

Shortcut to get button number or keycode from keyboard or mouse event. Returns Nothing if this is not mouse or keyboard event.

eventWindow :: Event -> Maybe WindowSource

Shortcut to get event window. Returns Nothing if this is not pointer-related event

eventKeyMask :: Event -> Maybe KeyMaskSource

Shortcut to get keymask from event

eventMousePos :: Event -> Maybe (Position, Position)Source

Shortcut to get pointer position from event