# Namespace KKeyServer

Module | kdeui
Namespace | KKeyServer

A collection of functions for the conversion of key presses and their modifiers from the window system specific format to the generic format and vice-versa.

### methods

- accelModMaskX ( )

  returns uint

  Returns bitwise OR'ed mask containing Shift, Ctrl, Alt, and Win (if available).

  See also modXShift()

  See also modXLock()

  See also modXCtrl()

  See also modXAlt()

  See also modXNumLock()

  See also modXWin()

  See also modXScrollLock()

- initializeMods ( )

  returns bool

- keyQtToCodeX (keyQt)

  returns bool, int (keyCode)

  Argument | Type | Default
  --- | --- | ---
  keyQt | int |

  Extracts the code from the given Qt key.

  keyQt - the qt key code

  keyCode - if successful, the symbol will be written here Returns true if successful, false otherwise

- keyQtToModX (keyQt)

  returns bool, uint (mod)

  Argument | Type | Default
  --- | --- | ---
  keyQt | int |

  Extracts the modifiers from the given Qt key and converts them in a mask of X11 modifiers.

  keyQt - the qt key code

  mod - if successful, the modifiers will be written here Returns true if successful, false otherwise

- keyQtToSymX (keyQt)

  returns bool, int (sym)

  Argument | Type | Default
  --- | --- | ---
  keyQt | int |

  Extracts the symbol from the given Qt key and converts it to an X11 symbol + modifiers.

  keyQt - the qt key code

  sym - if successful, the symbol will be written here Returns true if successful, false otherwise

- keyboardHasMetaKey ( )

  returns bool

  Returns true if the current keyboard layout supports the Meta key. Specifically, whether the Super or Meta keys are assigned to an X modifier. Returns true if the keyboard has a Meta key

  See also modXMeta()

- modToStringUser (mod)

  returns QString

  Argument | Type | Default
  --- | --- | ---
  mod | uint |

  Converts the mask of ORed KKey.ModFlag modifiers to a user-readable string.

  mod - the mask of ORed KKey.ModFlag modifiers Returns the user-readable string

- modXAlt ( )

  returns uint

  Returns the X11 Alt (Mod1) modifier mask/flag. Returns the X11 Alt (Mod1) modifier mask/flag.

  See also accelModMaskX()

- modXCtrl ( )

  returns uint

  Returns the X11 Ctrl modifier mask/flag. Returns the X11 Ctrl modifier mask/flag.

  See also accelModMaskX()

- modXLock ( )

  returns uint

  Returns the X11 Lock modifier mask/flag. Returns the X11 Lock modifier mask/flag.

  See also accelModMaskX()

- modXLock ( )

  returns uint

  Returns the X11 Lock modifier mask/flag. Returns the X11 Lock modifier mask/flag.

  See also accelModMaskX()

- modXMeta ( )

  returns uint

  Returns the X11 Win (Mod3) modifier mask/flag. Returns the X11 Win (Mod3) modifier mask/flag.

  See also keyboardHasWinKey()

  See also accelModMaskX()

- modXModeSwitch ( )

  returns uint

  Returns the X11 Mode_switch modifier mask/flag. Returns the X11 Mode_switch modifier mask/flag.

  See also accelModMaskX()

- modXNumLock ( )

  returns uint

  Returns the X11 NumLock modifier mask/flag. Returns the X11 NumLock modifier mask/flag.

  See also accelModMaskX()

- modXScrollLock ( )

  returns uint

  Returns the X11 ScrollLock modifier mask/flag. Returns the X11 ScrollLock modifier mask/flag.

  See also accelModMaskX()

- modXShift ( )

  returns uint

  Returns the X11 Shift modifier mask/flag. Returns the X11 Shift modifier mask/flag.

  See also accelModMaskX()

- modXToQt (modX)

  returns bool, int (modQt)

  Argument | Type | Default
  --- | --- | ---
  modX | uint |

  Converts the mask of ORed X11 modifiers to a mask of ORed Qt key code modifiers.

  modX - the mask of X11 modifiers

  modQt - the mask of Qt key code modifiers will be written here if successful Returns true if successful, false otherwise

- stringUserToMod (mod)

  returns uint

  Argument | Type | Default
  --- | --- | ---
  mod | QString |

  Converts the modifier given as user-readable string to KKey.ModFlag modifier, or 0. Internal

- symXToKeyQt (sym)

  returns bool, int (keyQt)

  Argument | Type | Default
  --- | --- | ---
  sym | uint |

  Converts the given symbol to a Qt key code.

  sym - the symbol

  keyQt - if successful, the qt key code will be written here Returns true if successful, false otherwise

- xEventToQt (e, keyModQt)

  returns bool
  Not implemented

  Argument | Type | Default
  --- | --- | ---
  e | XEvent |
  keyModQt | int |

  Converts an X keypress event into a Qt key + modifier code

  e - the X11 keypress event

  keyModQt - the Qt keycode and mask of Qt key code modifiers will be written here if successful Returns true if successful, false otherwise