xkbcommon-0.0.3: Haskell bindings for libxkbcommon

Safe HaskellNone
LanguageHaskell98

Text.XkbCommon.Keymap

Synopsis

Documentation

data Keymap Source #

Keymap represents a compiled keymap object. (struct xkb_keymap)

data RMLVO Source #

The RMLVO type specifies preferences for keymap creation (struct xkb_rule_names)

Constructors

RMLVO 

Instances

noPrefs :: RMLVO Source #

Specify that no specific keymap is preferred by the program. Depending on the specified ContextFlags during Context creation, RMLVO specifications may be loaded from environment variables.

newKeymapFromNames :: Context -> RMLVO -> IO (Maybe Keymap) Source #

Create keymap from optional preference of Rules+Model+Layouts+Variants+Options Keymaps are immutable but creation can fail. IO because it loads from disk.

(xkb_keymap_new_from_names)

newKeymapFromString :: Context -> String -> Maybe Keymap Source #

Create keymap from string buffer instead of loading from disk Immutable but creation can fail. not IO because it just parses a string.

haskell-xkbcommon has no equivalent for xkb_keymap_new_from_file: just load it from disk manually.

NOTE this can actually be an IO operation when compilation fails! (error output to stdout)

(xkb_keymap_new_from_string)

keymapAsString :: Keymap -> String Source #

Convert a keymap to an enormous string buffer. Opposite of newKeymapFromString

(xkb_keymap_get_as_string)

keymapNumLayouts :: Keymap -> CLayoutIndex Source #

Get the number of layouts in the keymap. (xkb_keymap_num_layouts)

keymapKeyNumLayouts :: Keymap -> CKeycode -> CLayoutIndex Source #

Get the number of layouts for a specific key. (xkb_keymap_num_layouts_for_key)

keymapNumMods :: Keymap -> CModIndex Source #

Get the number of modifiers in the keymap.

Preferred API is keymapModifiers.

(xkb_keymap_num_mods)

keymapModName :: Keymap -> CModIndex -> String Source #

Get the name of a modifier by index. (xkb_keymap_mod_get_name)

Preferred API is keymapModifiers.

keymapModIdx :: Keymap -> String -> Maybe CModIndex Source #

Get the index of a modifier by name. (xkb_keymap_mod_get_index)

Preferred API is keymapModifiers.

keymapKeyNumLevels :: Keymap -> CKeycode -> CLayoutIndex -> CLevelIndex Source #

Get the number of shift levels for a specific key and layout. (xkb_keymap_num_levels_for_key)

keymapNumLeds :: Keymap -> CLedIndex Source #

Get the number of LEDs in the keymap. (xkb_keymap_num_leds)

Preferred API is keymapLeds

keymapLeds :: Keymap -> [String] Source #

Get the leds of a keymap.

keymapModifiers :: Keymap -> [String] Source #

Get the modifiers of a keymap.

keymapLedName :: Keymap -> CLedIndex -> String Source #

Get the name of a LED by index. (xkb_keymap_led_get_name)

Preferred API is keymapLeds

keymapKeyRepeats :: Keymap -> CKeycode -> Bool Source #

Determine whether a key should repeat or not. (xkb_keymap_key_repeats)