Documentation
¶
Overview ¶
Package xgbkb provides keyboard input utilities to be used alongside xgb and xgbutil.
Index ¶
- func Initialize(connection *xgbutil.XUtil)
- func IsOnNumpad(symbol xproto.Keysym) bool
- func KeycodeToKeysym(keycode xproto.Keycode, state uint16) (xproto.Keysym, rune)
- func KeysymToKeycode(symbol xproto.Keysym) (code xproto.Keycode)
- func KeysymToMask(symbol xproto.Keysym) uint16
- func KeysymToRune(keysym xproto.Keysym) rune
- type Modifiers
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Initialize ¶
Initialize grabs keyboard mapping information from the X server. This function must be called before calling any other functions in this package. keybind.Initialize must also be called before this function is called.
func IsOnNumpad ¶
IsOnNumpad returns whether the given keysym resides on the numpad.
func KeycodeToKeysym ¶
KeycodeToButton converts an X keycode to a tomo keycode. It implements a more fleshed out version of some of the logic found in xgbutil/keybind/encoding.go to get a full keycode to keysym conversion. To avoid redundant work, this function will also return the rune corresponding to the keycode.
func KeysymToKeycode ¶
KeysymToKeycode converts an X keysym to an X keycode, instead of the other way around.
func KeysymToMask ¶
KeysymToMask returns the X modmask for a given modifier key.
func KeysymToRune ¶
KeysymToRune takes in an X keysym and outputs a utf32 code point. If a corresponding code point was not found, zero will be returned.
Types ¶
type Modifiers ¶
type Modifiers struct { CapsLock bool ShiftLock bool NumLock bool ModeSwitch bool Shift bool Control bool Alt bool Meta bool Super bool Hyper bool }
Modifiers lists which modifier keys are toggled on or being pressed.
func StateToModifiers ¶
StateToModifiers converts a modifier state given by a keyboard or mouse event to a Modifiers struct.