KKeyServer

KKeyServer Namespace Reference

Functions

uint accelModMaskX ()
 
void checkDisplay ()
 
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 ()
 
bool keyQtToCodeX (int keyQt, int *keyCode)
 
QList< int > keyQtToCodeXs (int keyQt)
 
bool keyQtToModX (int keyQt, uint *mod)
 
bool keyQtToSymX (int keyQt, int *sym)
 
QList< int > keyQtToSymXs (int keyQt)
 
static QString modToString (uint mod, bool bUserSpace)
 
QString modToStringUser (uint mod)
 
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 xcbKeyPressEventToQt (xcb_generic_event_t *e, int *keyModQt)
 
bool xcbKeyPressEventToQt (xcb_key_press_event_t *e, int *keyModQt)
 
bool xEventToQt (XEvent *e, int *keyModQt)
 

Variables

static uint g_alt_mask
 
static bool g_bInitializedKKeyLabels
 
static bool g_bInitializedMods
 
static bool g_bMacLabels
 
static uint g_hyper_mask
 
static uint g_meta_mask
 
static uint g_modXModeSwitch
 
static uint g_modXNumLock
 
static uint g_modXScrollLock
 
static ModInfo g_rgModInfo [4]
 
static const TransKey g_rgQtToSymX []
 
static X11ModInfo g_rgX11ModInfo [4]
 
static uint g_super_mask
 
static const int MODE_SWITCH = 0x2000
 

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 1567 of file kkeyserver.cpp.

◆ checkDisplay()

void KKeyServer::checkDisplay ( )
inline

Definition at line 1066 of file kkeyserver.cpp.

◆ codeXToSym()

bool KKeyServer::codeXToSym ( uchar codeX,
uint modX,
uint * sym )

Definition at line 1546 of file kkeyserver.cpp.

◆ getModsRequired()

uint KKeyServer::getModsRequired ( uint sym)

Definition at line 1311 of file 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 1086 of file kkeyserver.cpp.

◆ intializeKKeyLabels()

static void KKeyServer::intializeKKeyLabels ( )
static

Definition at line 59 of file kkeyserver.cpp.

◆ is_keypad_key()

static bool KKeyServer::is_keypad_key ( xcb_keysym_t keysym)
static

Definition at line 1248 of file 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 106 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 1306 of file kkeyserver.cpp.

◆ keyQtToCodeX()

KWINDOWSYSTEM_EXPORT bool KKeyServer::keyQtToCodeX ( int keyQt,
int * keyCode )

Extracts the code from the given Qt key.

Parameters
keyQtthe qt key code
keyCodeif successful, the symbol will be written here
Returns
true if successful, false otherwise
Deprecated
Since 6.0, Use keyQtToCodeXs(keyQt)

Definition at line 1353 of file kkeyserver.cpp.

◆ keyQtToCodeXs()

KWINDOWSYSTEM_EXPORT QList< int > KKeyServer::keyQtToCodeXs ( int keyQt)

Extracts the codes from the given Qt key.

Parameters
keyQtthe qt key code
returnthe codes; empty if unsuccessful

Definition at line 1378 of file 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
keyQtthe qt key code
modif successful, the modifiers will be written here
Returns
true if successful, false otherwise

Definition at line 1510 of file kkeyserver.cpp.

◆ 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
keyQtthe qt key code
symif successful, the symbol will be written here
Returns
true if successful, false otherwise
Deprecated
Since 6.0, Use keyQtToSymXs(keyQt)

Definition at line 1404 of file kkeyserver.cpp.

◆ keyQtToSymXs()

KWINDOWSYSTEM_EXPORT QList< int > KKeyServer::keyQtToSymXs ( int keyQt)

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

Parameters
keyQtthe qt key code
Returns
the symbols; emtpy if unsuccessful

Definition at line 1439 of file kkeyserver.cpp.

◆ modToString()

static QString KKeyServer::modToString ( uint mod,
bool bUserSpace )
static

Definition at line 73 of file kkeyserver.cpp.

◆ modToStringUser()

KWINDOWSYSTEM_EXPORT QString KKeyServer::modToStringUser ( uint mod)

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

Parameters
modthe mask of ORed KKey::ModFlag modifiers
Returns
the user-readable string (in English)

Definition at line 91 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 1265 of file 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 1261 of file 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 1287 of file 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 1272 of file 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 1298 of file 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 1280 of file 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 1291 of file 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 1257 of file 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
modXthe mask of X11 modifiers
modQtthe mask of Qt key code modifiers will be written here if successful
Returns
true if successful, false otherwise

Definition at line 1530 of file 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 96 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
keySymthe X key symbol
modXthe mask of X11 modifiers
keyQtif successful, the qt key code will be written here
Returns
true if successful, false otherwise

Definition at line 1467 of file 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
ethe XCB keypress event
keyModQtthe Qt keycode and mask of Qt key code modifiers will be written here if successful
Returns
true if successful, false otherwise

Definition at line 1612 of file 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 1620 of file kkeyserver.cpp.

◆ xEventToQt()

KWINDOWSYSTEM_EXPORT bool KKeyServer::xEventToQt ( XEvent * e,
int * keyModQt )

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

Parameters
ethe X11 keypress event
keyModQtthe Qt keycode and mask of Qt key code modifiers will be written here if successful
Returns
true if successful, false otherwise

Definition at line 1572 of file kkeyserver.cpp.

Variable Documentation

◆ g_alt_mask

uint KKeyServer::g_alt_mask
static

Definition at line 1084 of file kkeyserver.cpp.

◆ g_bInitializedKKeyLabels

bool KKeyServer::g_bInitializedKKeyLabels
static

Definition at line 56 of file kkeyserver.cpp.

◆ g_bInitializedMods

bool KKeyServer::g_bInitializedMods
static

Definition at line 1083 of file kkeyserver.cpp.

◆ g_bMacLabels

bool KKeyServer::g_bMacLabels
static

Definition at line 57 of file kkeyserver.cpp.

◆ g_hyper_mask

uint KKeyServer::g_hyper_mask
static

Definition at line 1084 of file kkeyserver.cpp.

◆ g_meta_mask

uint KKeyServer::g_meta_mask
static

Definition at line 1084 of file kkeyserver.cpp.

◆ g_modXModeSwitch

uint KKeyServer::g_modXModeSwitch
static

Definition at line 1084 of file kkeyserver.cpp.

◆ g_modXNumLock

uint KKeyServer::g_modXNumLock
static

Definition at line 1084 of file kkeyserver.cpp.

◆ g_modXScrollLock

uint KKeyServer::g_modXScrollLock
static

Definition at line 1084 of file kkeyserver.cpp.

◆ g_rgModInfo

ModInfo KKeyServer::g_rgModInfo[4]
static
Initial value:
= {
{Qt::SHIFT, "Shift", nullptr},
{Qt::CTRL, "Ctrl", nullptr},
{Qt::ALT, "Alt", nullptr},
{Qt::META, "Meta", nullptr},
}

Definition at line 46 of file kkeyserver.cpp.

◆ g_rgQtToSymX

const TransKey KKeyServer::g_rgQtToSymX[]
static

Definition at line 346 of file kkeyserver.cpp.

◆ g_rgX11ModInfo

X11ModInfo KKeyServer::g_rgX11ModInfo[4]
static
Initial value:
= {
{ Qt::SHIFT, X11_ONLY(ShiftMask) },
{ Qt::CTRL, X11_ONLY(ControlMask) },
{ Qt::ALT, X11_ONLY(Mod1Mask) },
{ Qt::META, X11_ONLY(Mod4Mask) }
}

Definition at line 338 of file kkeyserver.cpp.

◆ g_super_mask

uint KKeyServer::g_super_mask
static

Definition at line 1084 of file kkeyserver.cpp.

◆ MODE_SWITCH

const int KKeyServer::MODE_SWITCH = 0x2000
static

Definition at line 54 of file kkeyserver.h.

This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri May 3 2024 11:45:49 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.