Win32-2.14.2.0: A binding to Windows Win32 API.
Copyright(c) University of Glasgow 2006
LicenseBSD-style (see the file LICENSE)
MaintainerEsa Ilari Vuokko <ei@vuokko.info>
Stabilityprovisional
Portabilityportable
Safe HaskellTrustworthy
LanguageHaskell2010

System.Win32.Console

Description

A collection of FFI declarations for interfacing with Win32 Console API

Synopsis

Console mode

Console code pages

Ctrl events

Command line

commandLineToArgv :: String -> IO [String] Source #

This function can be used to parse command line arguments and return the split up arguments as elements in a list.

getArgs :: IO [String] Source #

Based on GetCommandLineW. This behaves slightly different than getArgs. See the online documentation: https://learn.microsoft.com/en-us/windows/win32/api/processenv/nf-processenv-getcommandlinew

Screen buffer

data CONSOLE_SCREEN_BUFFER_INFOEX Source #

Constructors

CONSOLE_SCREEN_BUFFER_INFOEX 

Fields

data COORD Source #

Constructors

COORD 

Fields

Instances

Instances details
Eq COORD Source # 
Instance details

Defined in System.Win32.Console.Internal

Methods

(==) :: COORD -> COORD -> Bool

(/=) :: COORD -> COORD -> Bool

Show COORD Source # 
Instance details

Defined in System.Win32.Console.Internal

Methods

showsPrec :: Int -> COORD -> ShowS

show :: COORD -> String

showList :: [COORD] -> ShowS

Storable COORD Source # 
Instance details

Defined in System.Win32.Console.Internal

Methods

sizeOf :: COORD -> Int

alignment :: COORD -> Int

peekElemOff :: Ptr COORD -> Int -> IO COORD

pokeElemOff :: Ptr COORD -> Int -> COORD -> IO ()

peekByteOff :: Ptr b -> Int -> IO COORD

pokeByteOff :: Ptr b -> Int -> COORD -> IO ()

peek :: Ptr COORD -> IO COORD

poke :: Ptr COORD -> COORD -> IO ()

data SMALL_RECT Source #

Constructors

SMALL_RECT 

Instances

Instances details
Eq SMALL_RECT Source # 
Instance details

Defined in System.Win32.Console.Internal

Methods

(==) :: SMALL_RECT -> SMALL_RECT -> Bool

(/=) :: SMALL_RECT -> SMALL_RECT -> Bool

Show SMALL_RECT Source # 
Instance details

Defined in System.Win32.Console.Internal

Methods

showsPrec :: Int -> SMALL_RECT -> ShowS

show :: SMALL_RECT -> String

showList :: [SMALL_RECT] -> ShowS

Storable SMALL_RECT Source # 
Instance details

Defined in System.Win32.Console.Internal

Methods

sizeOf :: SMALL_RECT -> Int

alignment :: SMALL_RECT -> Int

peekElemOff :: Ptr SMALL_RECT -> Int -> IO SMALL_RECT

pokeElemOff :: Ptr SMALL_RECT -> Int -> SMALL_RECT -> IO ()

peekByteOff :: Ptr b -> Int -> IO SMALL_RECT

pokeByteOff :: Ptr b -> Int -> SMALL_RECT -> IO ()

peek :: Ptr SMALL_RECT -> IO SMALL_RECT

poke :: Ptr SMALL_RECT -> SMALL_RECT -> IO ()

type COLORREF = Word32 Source #

Env

getEnv :: String -> IO (Maybe String) Source #

getEnvironment :: IO [(String, String)] Source #

Console I/O

data KEY_EVENT_RECORD 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

Instances

Instances details
Eq KEY_EVENT_RECORD Source # 
Instance details

Defined in System.Win32.Console.Internal

Show KEY_EVENT_RECORD Source # 
Instance details

Defined in System.Win32.Console.Internal

Methods

showsPrec :: Int -> KEY_EVENT_RECORD -> ShowS

show :: KEY_EVENT_RECORD -> String

showList :: [KEY_EVENT_RECORD] -> ShowS

Storable KEY_EVENT_RECORD Source # 
Instance details

Defined in System.Win32.Console.Internal

data MOUSE_EVENT_RECORD Source #

This type represents a mouse event. The structure is documented here: https://learn.microsoft.com/en-us/windows/console/mouse-event-record-str

Instances

Instances details
Eq MOUSE_EVENT_RECORD Source # 
Instance details

Defined in System.Win32.Console.Internal

Show MOUSE_EVENT_RECORD Source # 
Instance details

Defined in System.Win32.Console.Internal

Methods

showsPrec :: Int -> MOUSE_EVENT_RECORD -> ShowS

show :: MOUSE_EVENT_RECORD -> String

showList :: [MOUSE_EVENT_RECORD] -> ShowS

Storable MOUSE_EVENT_RECORD Source # 
Instance details

Defined in System.Win32.Console.Internal

newtype MENU_EVENT_RECORD 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

Constructors

MENU_EVENT_RECORD 

Fields

Instances

Instances details
Eq MENU_EVENT_RECORD Source # 
Instance details

Defined in System.Win32.Console.Internal

Show MENU_EVENT_RECORD Source # 
Instance details

Defined in System.Win32.Console.Internal

Methods

showsPrec :: Int -> MENU_EVENT_RECORD -> ShowS

show :: MENU_EVENT_RECORD -> String

showList :: [MENU_EVENT_RECORD] -> ShowS

Storable MENU_EVENT_RECORD Source # 
Instance details

Defined in System.Win32.Console.Internal

newtype FOCUS_EVENT_RECORD 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

Constructors

FOCUS_EVENT_RECORD 

Fields

Instances

Instances details
Eq FOCUS_EVENT_RECORD Source # 
Instance details

Defined in System.Win32.Console.Internal

Show FOCUS_EVENT_RECORD Source # 
Instance details

Defined in System.Win32.Console.Internal

Methods

showsPrec :: Int -> FOCUS_EVENT_RECORD -> ShowS

show :: FOCUS_EVENT_RECORD -> String

showList :: [FOCUS_EVENT_RECORD] -> ShowS

Storable FOCUS_EVENT_RECORD Source # 
Instance details

Defined in System.Win32.Console.Internal

data INPUT_RECORD Source #

Description of a Windows console input event. Documented here: https://learn.microsoft.com/en-us/windows/console/input-record-str

Instances

Instances details
Eq INPUT_RECORD Source # 
Instance details

Defined in System.Win32.Console.Internal

Methods

(==) :: INPUT_RECORD -> INPUT_RECORD -> Bool

(/=) :: INPUT_RECORD -> INPUT_RECORD -> Bool

Show INPUT_RECORD Source # 
Instance details

Defined in System.Win32.Console.Internal

Methods

showsPrec :: Int -> INPUT_RECORD -> ShowS

show :: INPUT_RECORD -> String

showList :: [INPUT_RECORD] -> ShowS

Storable INPUT_RECORD Source # 
Instance details

Defined in System.Win32.Console.Internal

Methods

sizeOf :: INPUT_RECORD -> Int

alignment :: INPUT_RECORD -> Int

peekElemOff :: Ptr INPUT_RECORD -> Int -> IO INPUT_RECORD

pokeElemOff :: Ptr INPUT_RECORD -> Int -> INPUT_RECORD -> IO ()

peekByteOff :: Ptr b -> Int -> IO INPUT_RECORD

pokeByteOff :: Ptr b -> Int -> INPUT_RECORD -> IO ()

peek :: Ptr INPUT_RECORD -> IO INPUT_RECORD

poke :: Ptr INPUT_RECORD -> INPUT_RECORD -> IO ()

readConsoleInput :: HANDLE -> Int -> Ptr INPUT_RECORD -> IO Int Source #

Reads all available input records up to the amount specified by the len parameter.