kmonad
Copyright(c) David Janssen 2019
LicenseMIT
Maintainerjanssen.dhj@gmail.com
Stabilityexperimental
Portabilityportable
Safe HaskellSafe-Inferred
LanguageHaskell2010

KMonad.Keyboard.IO.Windows.Types

Description

Windows in general. There is some translation happening in the c-code.

Synopsis

Documentation

data WinError Source #

Everything that can go wrong with Windows Key-IO

Constructors

NoWinKeycodeTo Keycode

Error translating to WinKeycode

NoWinKeycodeFrom WinKeycode

Error translating from WinKeycode

data WinKeyEvent Source #

WinKeyEvent is the C-representation of a a KeyEvent for our Windows API.

It contains a Word8 signifying whether the event was a Press (0) or Release (1), and a Word32 (Windows DWORD) signifying the *Windows keycode*.

NOTE: Windows and Linux keycodes do not line up. Internally we use Linux Keycodes for everything, we translate at the KeyIO stage (here).

mkWinKeyEvent :: WinSwitch -> WinKeycode -> WinKeyEvent Source #

toWinKeyEvent :: KeyEvent -> Either WinError WinKeyEvent Source #

Convert a KeyEvent to a WinKeyEvent

NOTE: Windows keycodes are different, and I am not confident I have full coverage, therefore this conversion is not total. We are going to leave this error-handling in until we are sure this is covered well. Once it lines up perfectly, this is essentially an Iso.

fromWinKeyEvent :: WinKeyEvent -> Either WinError KeyEvent Source #

Convert a WinKeyEvent to a KeyEvent

NOTE: Same limitations as toWinKeyEvent apply

winCodeKeyCodeMapping :: [(WinKeycode, Keycode)] Source #

A table of which virtual-key code from Windows correspond to which KMonad KeyCode. This table may have the same virtual-key code from Windows multiple times and also may have the same KMonad KeyCode multiple times.

It is essentially a merge of winCodeToKeyCode and keyCodeToWinCode.