MyNixOS website logo
Description

Haskell bindings for libxkbcommon.

Wrapper library for libxkbcommon, which is the new alternative for the X11 XKB.h keyboard input API. Specifically, it finds keymap files from disk based on Rule/Model/Layout/Variant/Option specifications, and compiles them into a Keymap. From this Keymap, a KeyboardState can be constructed which represents the states of various physical buttons such as the shiftaltctrl keys, and can give the correct key symbol based on keyboard events. E.g., pressing the <h> key while <shift> is pressed produces the H symbol in the common QWERTY keymaps, but in e.g. the Dvorak keymap, it produces the D symbol.

After keymap creation, which libxkbcommon can do based on locale preferences and enviroment variables, this is all handled by routing keyboard events through libxkbcommon.

At this stage, these haskell bindings do not make libxkbcommon look much like a haskell library. For example, in principle the entire libxkbcommon library is just a stateful processor, and has nothing to do with the IO monad. However, because I am not yet a very good haskell programmer, and because in most realistic use cases input data comes from the IO monad anyway, the stateful operations are encoded in the IO monad anyway.

Note that these bindings load the keysym constants from the libxkbcommon C header files at compile time using TH, and similarly keycodes from the Linux header files. These should be present for correct compilation.

Metadata

Version

0.0.3

License

Platforms (75)

    Darwin
    FreeBSD 13
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd13
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd13
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows