Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
This module provides a function to obtain input events from the Win32 API
Synopsis
- data KeyEventRecord = KeyEventRecordC {
- keyDown :: BOOL
- repeatCount :: WORD
- virtualKeyCode :: WORD
- virtualScanCode :: WORD
- uChar :: CWchar
- controlKeyStateK :: DWORD
- data MouseEventRecord = MouseEventRecordC {
- mousePosition :: COORD
- buttonState :: DWORD
- controlKeyStateM :: DWORD
- eventFlags :: DWORD
- newtype WindowBufferSizeRecord = WindowBufferSizeRecordC {
- windowSize :: COORD
- newtype MenuEventRecord = MenuEventRecordC {
- commandId :: UINT
- newtype FocusEventRecord = FocusEventRecordC {
- setFocus :: BOOL
- data WinConsoleInputEvent
- readConsoleInput :: Ptr WinConsoleInputEvent -> Int -> Handle -> IO [WinConsoleInputEvent]
Documentation
data KeyEventRecord Source #
This type represents a keyboard input event. The structure is documented here: https://learn.microsoft.com/en-us/windows/console/key-event-record-str
KeyEventRecordC | |
|
Instances
Storable KeyEventRecord Source # | |
Defined in Graphics.Vty.Platform.Windows.WindowsConsoleInput sizeOf :: KeyEventRecord -> Int alignment :: KeyEventRecord -> Int peekElemOff :: Ptr KeyEventRecord -> Int -> IO KeyEventRecord pokeElemOff :: Ptr KeyEventRecord -> Int -> KeyEventRecord -> IO () peekByteOff :: Ptr b -> Int -> IO KeyEventRecord pokeByteOff :: Ptr b -> Int -> KeyEventRecord -> IO () peek :: Ptr KeyEventRecord -> IO KeyEventRecord poke :: Ptr KeyEventRecord -> KeyEventRecord -> IO () | |
Show KeyEventRecord Source # | |
Defined in Graphics.Vty.Platform.Windows.WindowsConsoleInput showsPrec :: Int -> KeyEventRecord -> ShowS show :: KeyEventRecord -> String showList :: [KeyEventRecord] -> ShowS | |
Eq KeyEventRecord Source # | |
Defined in Graphics.Vty.Platform.Windows.WindowsConsoleInput (==) :: KeyEventRecord -> KeyEventRecord -> Bool (/=) :: KeyEventRecord -> KeyEventRecord -> Bool |
data MouseEventRecord Source #
This type represents a mouse event. The structure is documented here: https://learn.microsoft.com/en-us/windows/console/mouse-event-record-str
MouseEventRecordC | |
|
Instances
Storable MouseEventRecord Source # | |
Defined in Graphics.Vty.Platform.Windows.WindowsConsoleInput sizeOf :: MouseEventRecord -> Int alignment :: MouseEventRecord -> Int peekElemOff :: Ptr MouseEventRecord -> Int -> IO MouseEventRecord pokeElemOff :: Ptr MouseEventRecord -> Int -> MouseEventRecord -> IO () peekByteOff :: Ptr b -> Int -> IO MouseEventRecord pokeByteOff :: Ptr b -> Int -> MouseEventRecord -> IO () peek :: Ptr MouseEventRecord -> IO MouseEventRecord poke :: Ptr MouseEventRecord -> MouseEventRecord -> IO () | |
Show MouseEventRecord Source # | |
Defined in Graphics.Vty.Platform.Windows.WindowsConsoleInput showsPrec :: Int -> MouseEventRecord -> ShowS show :: MouseEventRecord -> String showList :: [MouseEventRecord] -> ShowS | |
Eq MouseEventRecord Source # | |
Defined in Graphics.Vty.Platform.Windows.WindowsConsoleInput (==) :: MouseEventRecord -> MouseEventRecord -> Bool (/=) :: MouseEventRecord -> MouseEventRecord -> Bool |
newtype WindowBufferSizeRecord Source #
This type represents a window size change event. The structure is documented here: https://learn.microsoft.com/en-us/windows/console/window-buffer-size-record-str
WindowBufferSizeRecordC | |
|
Instances
newtype MenuEventRecord Source #
This type represents a window menu event. (Current ignored by VTY). The structure is documented here: https://learn.microsoft.com/en-us/windows/console/menu-event-record-str
MenuEventRecordC | |
|
Instances
Storable MenuEventRecord Source # | |
Defined in Graphics.Vty.Platform.Windows.WindowsConsoleInput sizeOf :: MenuEventRecord -> Int alignment :: MenuEventRecord -> Int peekElemOff :: Ptr MenuEventRecord -> Int -> IO MenuEventRecord pokeElemOff :: Ptr MenuEventRecord -> Int -> MenuEventRecord -> IO () peekByteOff :: Ptr b -> Int -> IO MenuEventRecord pokeByteOff :: Ptr b -> Int -> MenuEventRecord -> IO () peek :: Ptr MenuEventRecord -> IO MenuEventRecord poke :: Ptr MenuEventRecord -> MenuEventRecord -> IO () | |
Show MenuEventRecord Source # | |
Defined in Graphics.Vty.Platform.Windows.WindowsConsoleInput showsPrec :: Int -> MenuEventRecord -> ShowS show :: MenuEventRecord -> String showList :: [MenuEventRecord] -> ShowS | |
Eq MenuEventRecord Source # | |
Defined in Graphics.Vty.Platform.Windows.WindowsConsoleInput (==) :: MenuEventRecord -> MenuEventRecord -> Bool (/=) :: MenuEventRecord -> MenuEventRecord -> Bool |
newtype FocusEventRecord Source #
This type represents a window focus change event. The structure is documented here: https://learn.microsoft.com/en-us/windows/console/focus-event-record-str
FocusEventRecordC | |
|
Instances
Storable FocusEventRecord Source # | |
Defined in Graphics.Vty.Platform.Windows.WindowsConsoleInput sizeOf :: FocusEventRecord -> Int alignment :: FocusEventRecord -> Int peekElemOff :: Ptr FocusEventRecord -> Int -> IO FocusEventRecord pokeElemOff :: Ptr FocusEventRecord -> Int -> FocusEventRecord -> IO () peekByteOff :: Ptr b -> Int -> IO FocusEventRecord pokeByteOff :: Ptr b -> Int -> FocusEventRecord -> IO () peek :: Ptr FocusEventRecord -> IO FocusEventRecord poke :: Ptr FocusEventRecord -> FocusEventRecord -> IO () | |
Show FocusEventRecord Source # | |
Defined in Graphics.Vty.Platform.Windows.WindowsConsoleInput showsPrec :: Int -> FocusEventRecord -> ShowS show :: FocusEventRecord -> String showList :: [FocusEventRecord] -> ShowS | |
Eq FocusEventRecord Source # | |
Defined in Graphics.Vty.Platform.Windows.WindowsConsoleInput (==) :: FocusEventRecord -> FocusEventRecord -> Bool (/=) :: FocusEventRecord -> FocusEventRecord -> Bool |
data WinConsoleInputEvent Source #
Description of a Windows console input event. Documented here: https://learn.microsoft.com/en-us/windows/console/input-record-str
KeyEventRecordU KeyEventRecord | |
MouseEventRecordU MouseEventRecord | |
WindowBufferSizeRecordU WindowBufferSizeRecord | |
MenuEventRecordU MenuEventRecord | |
FocusEventRecordU FocusEventRecord |
Instances
readConsoleInput :: Ptr WinConsoleInputEvent -> Int -> Handle -> IO [WinConsoleInputEvent] Source #
A wrapper for the ReadConsoleInput Win32 API as documented here: https://learn.microsoft.com/en-us/windows/console/readconsoleinput