Safe Haskell | None |
---|---|
Language | Haskell98 |
This module is intended to be used only when interoperating with other C libraries.
For other usecases, Types
is probably preferable.
- data Context
- data CContext
- type InternalContext = ForeignPtr CContext
- toContext :: InternalContext -> Context
- fromContext :: Context -> InternalContext
- withContext :: Context -> (Ptr CContext -> IO a) -> IO a
- newtype ContextFlags = ContextFlags Word32
- defaultFlags :: ContextFlags
- pureFlags :: ContextFlags
- contextNoDefaultIncludes :: ContextFlags
- contextNoEnvironment :: ContextFlags
- data Keymap
- data CKeymap
- type InternalKeymap = ForeignPtr CKeymap
- toKeymap :: InternalKeymap -> Keymap
- fromKeymap :: Keymap -> InternalKeymap
- withKeymap :: Keymap -> (Ptr CKeymap -> IO a) -> IO a
- data RMLVO = RMLVO {}
- noPrefs :: RMLVO
- data KeyboardState
- data CKeyboardState
- toKeyboardState :: InternalKeyboardState -> KeyboardState
- fromKeyboardState :: KeyboardState -> InternalKeyboardState
- withKeyboardState :: KeyboardState -> (Ptr CKeyboardState -> IO a) -> IO a
- readCString :: CString -> IO String
- newtype Direction = Direction Word32
- keyUp :: Direction
- keyDown :: Direction
- newtype CKeysym = CKeysym {}
- newtype Keysym = Keysym Int
- toKeysym :: CKeysym -> Keysym
- fromKeysym :: Keysym -> CKeysym
- safeToKeysym :: CKeysym -> Maybe Keysym
- newtype CLogLevel = CLogLevel Word32
- newtype CKeycode = CKeycode {
- unCKeycode :: Word32
- newtype CLayoutIndex = CLayoutIndex Word32
- newtype CModIndex = CModIndex {}
- newtype CLevelIndex = CLevelIndex Word32
- newtype CLedIndex = CLedIndex {}
- newtype StateComponent = StateComponent Word32
- newtype CModMask = CModMask Word32
- stateModDepressed :: StateComponent
- stateModLatched :: StateComponent
- stateModLocked :: StateComponent
- stateModEffective :: StateComponent
- stateLayoutDepressed :: StateComponent
- stateLayoutLatched :: StateComponent
- stateLayoutLocked :: StateComponent
- stateLayoutEffective :: StateComponent
- stateLeds :: StateComponent
Documentation
type InternalContext = ForeignPtr CContext Source #
toContext :: InternalContext -> Context Source #
fromContext :: Context -> InternalContext Source #
newtype ContextFlags Source #
ContextFlags
carry options for construction of a Context
. (enum xkb_context_flags
)
defaultFlags :: ContextFlags Source #
Default ContextFlags
: consider RMLVO prefs from the environment variables, and search for Keymap
files in the default paths.
pureFlags :: ContextFlags Source #
Pure ContextFlags
: don't consider env vars or default search paths, which are system-dependent.
type InternalKeymap = ForeignPtr CKeymap Source #
toKeymap :: InternalKeymap -> Keymap Source #
fromKeymap :: Keymap -> InternalKeymap Source #
The RMLVO type specifies preferences for keymap creation
(struct xkb_rule_names
)
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.
data KeyboardState Source #
KeyboardState
represents the state of a connected keyboard. (struct xkb_state
)
data CKeyboardState Source #
toKeyboardState :: InternalKeyboardState -> KeyboardState Source #
fromKeyboardState :: KeyboardState -> InternalKeyboardState Source #
withKeyboardState :: KeyboardState -> (Ptr CKeyboardState -> IO a) -> IO a Source #
One graphical symbol (usually on-screen). This is the end product of libxkbcommon. Some keysyms are not graphical characters, but can also represent e.g. Left or Right arrow keys. Refer to the libxkbcommon documentation for details.
NOTE that XKB_KEY_NoSymbol
is represented by a Nothing
in haskell-xkbcommon.
(xkb_keysym_t
)
fromKeysym :: Keysym -> CKeysym Source #
One keyboard key. Events on keys are the input of libxkbcommon.
newtype CLayoutIndex Source #
Index of a keyboard layout.
The layout index is a state component which detemines which keyboard layout is active. These may be different alphabets, different key arrangements, etc.
Layout indexes are consecutive. The first layout has index 0.
Each layout is not required to have a name, and the names are not guaranteed to be unique (though they are usually provided and unique). Therefore, it is not safe to use the name as a unique identifier for a layout. Layout names are case-sensitive.
Layouts are also called "groups" by XKB.
Index of a modifier.
A modifier is a state component which changes the way keys are interpreted. A keymap defines a set of modifiers, such as Alt, Shift, Num Lock or Meta, and specifies which keys may activate which modifiers (in a many-to-many relationship, i.e. a key can activate several modifiers, and a modifier may be activated by several keys. Different keymaps do this differently).
When retrieving the keysyms for a key, the active modifier set is consulted;
this detemines the correct shift level to use within the currently active layout
(see CLevelIndex
).
Modifier indexes are consecutive. The first modifier has index 0.
newtype StateComponent Source #
Modifier and layout types for state objects.
In XKB, the DEPRESSED components are also known as 'base'.
(xkb_state_component
)