KKeyServer
Functions | |
uint | accelModMaskX () |
void | checkDisplay () |
bool | codeWinToKeyQt (uint sym, int *keyQt) |
bool | codeXToSym (uchar codeX, uint modX, uint *sym) |
uint | getModsRequired (uint sym) |
bool | initializeMods () |
static void | intializeKKeyLabels () |
static bool | is_keypad_key (xcb_keysym_t keysym) |
bool | isShiftAsModifierAllowed (int keyQt) |
bool | keyboardHasMetaKey () |
KWINDOWSYSTEM_EXPORT bool | keyQtToCodeMac (int keyQt, QList< uint > &keyCodes) |
bool | keyQtToCodeWin (int keyQt, uint *sym) |
bool | keyQtToCodeX (int keyQt, int *keyCode) |
KWINDOWSYSTEM_EXPORT bool | keyQtToModMac (int keyQt, uint &mod) |
bool | keyQtToModWin (int keyQt, uint *mod) |
bool | keyQtToModX (int keyQt, uint *mod) |
KWINDOWSYSTEM_EXPORT bool | keyQtToSymMac (int keyQt, int &sym) |
bool | keyQtToSymX (int keyQt, int *sym) |
static QString | modToString (uint mod, bool bUserSpace) |
QString | modToStringUser (uint mod) |
bool | modWinToKeyQt (uint mod, int *keyQt) |
uint | modXAlt () |
uint | modXCtrl () |
uint | modXLock () |
uint | modXMeta () |
uint | modXModeSwitch () |
uint | modXNumLock () |
uint | modXScrollLock () |
uint | modXShift () |
bool | modXToQt (uint modX, int *modQt) |
uint | stringUserToMod (const QString &mod) |
bool | symXModXToKeyQt (uint32_t keySym, uint16_t modX, int *keyQt) |
bool | symXToKeyQt (uint sym, int *keyQt) |
bool | xcbKeyPressEventToQt (xcb_generic_event_t *e, int *keyModQt) |
bool | xcbKeyPressEventToQt (xcb_key_press_event_t *e, int *keyModQt) |
bool | xEventToQt (XEvent *e, int *keyModQt) |
Detailed Description
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.
Function Documentation
◆ accelModMaskX()
KWINDOWSYSTEM_EXPORT uint KKeyServer::accelModMaskX | ( | ) |
Returns bitwise OR'ed mask containing Shift, Ctrl, Alt, and Win (if available).
- See also
- modXShift()
- modXLock()
- modXCtrl()
- modXAlt()
- modXNumLock()
- modXWin()
- modXScrollLock()
Definition at line 912 of file platforms/xcb/kkeyserver.cpp.
◆ initializeMods()
KWINDOWSYSTEM_EXPORT bool KKeyServer::initializeMods | ( | ) |
Initialises the values to return for the mod*() functions below.
Called automatically by those functions if not already initialized.
Definition at line 481 of file platforms/xcb/kkeyserver.cpp.
◆ isShiftAsModifierAllowed()
KWINDOWSYSTEM_EXPORT bool KKeyServer::isShiftAsModifierAllowed | ( | int | keyQt | ) |
Test if the shift modifier should be recorded for a given key.
For example, if shift+5 produces '' Qt wants ctrl+shift+5 recorded as ctrl+% and in that case this function would return false.
- Since
- 4.7.1
Definition at line 93 of file kkeyserver.cpp.
◆ keyboardHasMetaKey()
KWINDOWSYSTEM_EXPORT bool KKeyServer::keyboardHasMetaKey | ( | ) |
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()
Definition at line 701 of file platforms/xcb/kkeyserver.cpp.
◆ keyQtToCodeMac()
KWINDOWSYSTEM_EXPORT bool KKeyServer::keyQtToCodeMac | ( | int | keyQt, |
QList< uint > & | keyCodes | ||
) |
Extracts all the scancodes from the given Qt key.
The returned values can change if a different keyboard layout is selected.
- Parameters
-
keyQt the qt key code keyCodes if successful, a list of scancodes will be written here
- Returns
- true if successful, false otherwise
◆ keyQtToCodeWin()
KWINDOWSYSTEM_EXPORT bool KKeyServer::keyQtToCodeWin | ( | int | keyQt, |
uint * | sym | ||
) |
Extracts the symbol from the given Qt key and converts it to a Windows symbol.
- Parameters
-
keyQt the qt key code sym if successful, the symbol will be written here
- Returns
- true if successful, false otherwise
Definition at line 224 of file platforms/windows/kkeyserver.cpp.
◆ keyQtToCodeX()
KWINDOWSYSTEM_EXPORT bool KKeyServer::keyQtToCodeX | ( | int | keyQt, |
int * | keyCode | ||
) |
Extracts the code from the given Qt key.
- Parameters
-
keyQt the qt key code keyCode if successful, the symbol will be written here
- Returns
- true if successful, false otherwise
Definition at line 747 of file platforms/xcb/kkeyserver.cpp.
◆ keyQtToModMac()
KWINDOWSYSTEM_EXPORT bool KKeyServer::keyQtToModMac | ( | int | keyQt, |
uint & | mod | ||
) |
Extracts the modifiers from the given Qt key and converts them in a mask of OSX modifiers.
- Parameters
-
keyQt the qt key code mod if successful, the modifiers will be written here
- Returns
- true if successful, false otherwise
◆ keyQtToModWin()
KWINDOWSYSTEM_EXPORT bool KKeyServer::keyQtToModWin | ( | int | keyQt, |
uint * | mod | ||
) |
Extracts the modifiers from the given Qt key and converts them in a mask of Windows modifiers.
- Parameters
-
keyQt the qt key code mod if successful, the modifiers will be written here
- Returns
- true if successful, false otherwise
Definition at line 186 of file platforms/windows/kkeyserver.cpp.
◆ keyQtToModX()
KWINDOWSYSTEM_EXPORT bool KKeyServer::keyQtToModX | ( | int | keyQt, |
uint * | mod | ||
) |
Extracts the modifiers from the given Qt key and converts them in a mask of X11 modifiers.
- Parameters
-
keyQt the qt key code mod if successful, the modifiers will be written here
- Returns
- true if successful, false otherwise
Definition at line 855 of file platforms/xcb/kkeyserver.cpp.
◆ keyQtToSymMac()
KWINDOWSYSTEM_EXPORT bool KKeyServer::keyQtToSymMac | ( | int | keyQt, |
int & | sym | ||
) |
Extracts the symbol from the given Qt key, and converts it to an OSX symbol.
- Parameters
-
keyQt the qt key code sym if successful, the symbol will be written here
- Returns
- true if successful, false otherwise
◆ keyQtToSymX()
KWINDOWSYSTEM_EXPORT bool KKeyServer::keyQtToSymX | ( | int | keyQt, |
int * | sym | ||
) |
Extracts the symbol from the given Qt key and converts it to an X11 symbol + modifiers.
- Parameters
-
keyQt the qt key code sym if successful, the symbol will be written here
- Returns
- true if successful, false otherwise
Definition at line 771 of file platforms/xcb/kkeyserver.cpp.
◆ modToStringUser()
KWINDOWSYSTEM_EXPORT QString KKeyServer::modToStringUser | ( | uint | mod | ) |
Converts the mask of ORed KKey::ModFlag modifiers to a user-readable string.
- Parameters
-
mod the mask of ORed KKey::ModFlag modifiers
- Returns
- the user-readable string (in English)
Definition at line 78 of file kkeyserver.cpp.
◆ modXAlt()
KWINDOWSYSTEM_EXPORT uint KKeyServer::modXAlt | ( | ) |
Returns the X11 Alt (Mod1) modifier mask/flag.
- Returns
- the X11 Alt (Mod1) modifier mask/flag.
- See also
- accelModMaskX()
Definition at line 660 of file platforms/xcb/kkeyserver.cpp.
◆ modXCtrl()
KWINDOWSYSTEM_EXPORT uint KKeyServer::modXCtrl | ( | ) |
Returns the X11 Ctrl modifier mask/flag.
- Returns
- the X11 Ctrl modifier mask/flag.
- See also
- accelModMaskX()
Definition at line 656 of file platforms/xcb/kkeyserver.cpp.
◆ modXLock()
KWINDOWSYSTEM_EXPORT uint KKeyServer::modXLock | ( | ) |
Returns the X11 Lock modifier mask/flag.
- Returns
- the X11 Lock modifier mask/flag.
- See also
- accelModMaskX()
Definition at line 682 of file platforms/xcb/kkeyserver.cpp.
◆ modXMeta()
KWINDOWSYSTEM_EXPORT uint KKeyServer::modXMeta | ( | ) |
Returns the X11 Win (Mod3) modifier mask/flag.
- Returns
- the X11 Win (Mod3) modifier mask/flag.
- See also
- keyboardHasWinKey()
- accelModMaskX()
Definition at line 667 of file platforms/xcb/kkeyserver.cpp.
◆ modXModeSwitch()
KWINDOWSYSTEM_EXPORT uint KKeyServer::modXModeSwitch | ( | ) |
Returns the X11 Mode_switch modifier mask/flag.
- Returns
- the X11 Mode_switch modifier mask/flag.
- See also
- accelModMaskX()
Definition at line 693 of file platforms/xcb/kkeyserver.cpp.
◆ modXNumLock()
KWINDOWSYSTEM_EXPORT uint KKeyServer::modXNumLock | ( | ) |
Returns the X11 NumLock modifier mask/flag.
- Returns
- the X11 NumLock modifier mask/flag.
- See also
- accelModMaskX()
Definition at line 675 of file platforms/xcb/kkeyserver.cpp.
◆ modXScrollLock()
KWINDOWSYSTEM_EXPORT uint KKeyServer::modXScrollLock | ( | ) |
Returns the X11 ScrollLock modifier mask/flag.
- Returns
- the X11 ScrollLock modifier mask/flag.
- See also
- accelModMaskX()
Definition at line 686 of file platforms/xcb/kkeyserver.cpp.
◆ modXShift()
KWINDOWSYSTEM_EXPORT uint KKeyServer::modXShift | ( | ) |
Returns the X11 Shift modifier mask/flag.
- Returns
- the X11 Shift modifier mask/flag.
- See also
- accelModMaskX()
Definition at line 652 of file platforms/xcb/kkeyserver.cpp.
◆ modXToQt()
KWINDOWSYSTEM_EXPORT bool KKeyServer::modXToQt | ( | uint | modX, |
int * | modQt | ||
) |
Converts the mask of ORed X11 modifiers to a mask of ORed Qt key code modifiers.
- Parameters
-
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
Definition at line 875 of file platforms/xcb/kkeyserver.cpp.
◆ stringUserToMod()
KWINDOWSYSTEM_EXPORT uint KKeyServer::stringUserToMod | ( | const QString & | mod | ) |
Converts the modifier given as user-readable string (in English) to KKey::ModFlag modifier, or 0.
Definition at line 83 of file kkeyserver.cpp.
◆ symXModXToKeyQt()
KWINDOWSYSTEM_EXPORT bool KKeyServer::symXModXToKeyQt | ( | uint32_t | keySym, |
uint16_t | modX, | ||
int * | keyQt | ||
) |
Converts the given symbol and modifier combination to a Qt key code.
- Parameters
-
keySym the X key symbol modX the mask of X11 modifiers keyQt if successful, the qt key code will be written here
- Returns
- true if successful, false otherwise
Definition at line 805 of file platforms/xcb/kkeyserver.cpp.
◆ symXToKeyQt()
KWINDOWSYSTEM_EXPORT bool KKeyServer::symXToKeyQt | ( | uint | sym, |
int * | keyQt | ||
) |
Converts the given symbol to a Qt key code.
- Parameters
-
sym the symbol keyQt if successful, the qt key code will be written here
- Returns
- true if successful, false otherwise
- Deprecated:
- since 5.38, use symXModXToKeyQt in order to support numeric keypad keys too
Definition at line 849 of file platforms/xcb/kkeyserver.cpp.
◆ xcbKeyPressEventToQt() [1/2]
KWINDOWSYSTEM_EXPORT bool KKeyServer::xcbKeyPressEventToQt | ( | xcb_generic_event_t * | e, |
int * | keyModQt | ||
) |
Converts an XCB keypress event into a Qt key + modifier code.
- Parameters
-
e the XCB 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
Definition at line 957 of file platforms/xcb/kkeyserver.cpp.
◆ xcbKeyPressEventToQt() [2/2]
KWINDOWSYSTEM_EXPORT bool KKeyServer::xcbKeyPressEventToQt | ( | xcb_key_press_event_t * | e, |
int * | keyQt | ||
) |
Overloaded method for convenience.
Definition at line 965 of file platforms/xcb/kkeyserver.cpp.
◆ xEventToQt()
KWINDOWSYSTEM_EXPORT bool KKeyServer::xEventToQt | ( | XEvent * | e, |
int * | keyModQt | ||
) |
Converts an X keypress event into a Qt key + modifier code.
- Parameters
-
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
Definition at line 917 of file platforms/xcb/kkeyserver.cpp.
Variable Documentation
◆ g_rgModInfo
|
static |
◆ g_rgX11ModInfo
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon May 8 2023 03:54:20 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.