• Skip to content
  • Skip to link menu
KDE 4.1 API Reference
  • KDE API Reference
  • kdelibs
  • Sitemap
  • Contact Us
 

KDEUI

KKeyServer Namespace Reference


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.


Functions

uint accelModMaskX ()
void checkDisplay ()
bool codeXToSym (uchar codeX, uint modX, uint *sym)
uint getModsRequired (uint sym)
bool initializeMods ()
static void intializeKKeyLabels ()
bool keyboardHasMetaKey ()
bool keyQtToCodeMac (int keyQt, QList< uint > &keyCodes)
bool keyQtToCodeX (int keyQt, int *keyCode)
bool keyQtToModMac (int keyQt, uint &mod)
bool keyQtToModX (int keyQt, uint *mod)
bool keyQtToSymMac (int keyQt, int &sym)
bool keyQtToSymX (int keyQt, int *sym)
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 symXToKeyQt (uint sym, int *keyQt)
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_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 const SymName g_rgSymNames []
static X11ModInfo g_rgX11ModInfo [4]
static const int MODE_SWITCH = 0x2000

Function Documentation

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 551 of file kkeyserver_x11.cpp.

void KKeyServer::checkDisplay (  )  [inline]

Definition at line 291 of file kkeyserver_x11.cpp.

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

Definition at line 533 of file kkeyserver_x11.cpp.

uint KKeyServer::getModsRequired ( uint  sym  ) 

Definition at line 388 of file kkeyserver_x11.cpp.

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 311 of file kkeyserver_x11.cpp.

static void KKeyServer::intializeKKeyLabels (  )  [static]

Definition at line 64 of file kkeyserver.cpp.

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 385 of file kkeyserver_x11.cpp.

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

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 419 of file kkeyserver_x11.cpp.

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

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 502 of file kkeyserver_x11.cpp.

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

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 451 of file kkeyserver_x11.cpp.

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

Definition at line 80 of file kkeyserver.cpp.

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

Definition at line 98 of file kkeyserver.cpp.

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 377 of file kkeyserver_x11.cpp.

uint KKeyServer::modXCtrl (  ) 

Returns the X11 Ctrl modifier mask/flag.

Returns:
the X11 Ctrl modifier mask/flag.
See also:
accelModMaskX()

Definition at line 376 of file kkeyserver_x11.cpp.

uint KKeyServer::modXLock (  ) 

Returns the X11 Lock modifier mask/flag.

Returns:
the X11 Lock modifier mask/flag.
See also:
accelModMaskX()

Definition at line 381 of file kkeyserver_x11.cpp.

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 378 of file kkeyserver_x11.cpp.

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 383 of file kkeyserver_x11.cpp.

uint KKeyServer::modXNumLock (  ) 

Returns the X11 NumLock modifier mask/flag.

Returns:
the X11 NumLock modifier mask/flag.
See also:
accelModMaskX()

Definition at line 380 of file kkeyserver_x11.cpp.

uint KKeyServer::modXScrollLock (  ) 

Returns the X11 ScrollLock modifier mask/flag.

Returns:
the X11 ScrollLock modifier mask/flag.
See also:
accelModMaskX()

Definition at line 382 of file kkeyserver_x11.cpp.

uint KKeyServer::modXShift (  ) 

Returns the X11 Shift modifier mask/flag.

Returns:
the X11 Shift modifier mask/flag.
See also:
accelModMaskX()

Definition at line 375 of file kkeyserver_x11.cpp.

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 517 of file kkeyserver_x11.cpp.

uint KKeyServer::stringUserToMod ( const QString &  mod  ) 

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

For internal use only.

Definition at line 103 of file kkeyserver.cpp.

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

Definition at line 475 of file kkeyserver_x11.cpp.

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 557 of file kkeyserver_x11.cpp.


Variable Documentation

uint KKeyServer::g_alt_mask [static]

Definition at line 309 of file kkeyserver_x11.cpp.

bool KKeyServer::g_bInitializedKKeyLabels [static]

Definition at line 61 of file kkeyserver.cpp.

bool KKeyServer::g_bInitializedMods [static]

Definition at line 308 of file kkeyserver_x11.cpp.

bool KKeyServer::g_bMacLabels [static]

Definition at line 62 of file kkeyserver.cpp.

uint KKeyServer::g_meta_mask [static]

Definition at line 309 of file kkeyserver_x11.cpp.

uint KKeyServer::g_modXModeSwitch [static]

Definition at line 309 of file kkeyserver_x11.cpp.

uint KKeyServer::g_modXNumLock [static]

Definition at line 309 of file kkeyserver_x11.cpp.

uint KKeyServer::g_modXScrollLock [static]

Definition at line 309 of file kkeyserver_x11.cpp.

ModInfo KKeyServer::g_rgModInfo[4] [static]

Initial value:

{
    { Qt::SHIFT,   "Shift", 0 },
    { Qt::CTRL,    "Ctrl", 0 },
    { Qt::ALT,     "Alt", 0 },
    { Qt::META,    "Meta", 0 }
}

Definition at line 50 of file kkeyserver.cpp.

const TransKey KKeyServer::g_rgQtToSymX[] [static]

Definition at line 125 of file kkeyserver_x11.cpp.

const SymName KKeyServer::g_rgSymNames[] [static]

Initial value:

 {
    { XK_ISO_Left_Tab, "Backtab" },
    { XK_BackSpace,    I18N_NOOP("Backspace") },
    { XK_Sys_Req,      I18N_NOOP("SysReq") },
    { XK_Caps_Lock,    I18N_NOOP("CapsLock") },
    { XK_Num_Lock,     I18N_NOOP("NumLock") },
    { XK_Scroll_Lock,  I18N_NOOP("ScrollLock") },
    { XK_Prior,        I18N_NOOP("PageUp") },
    { XK_Next,         I18N_NOOP("PageDown") },













    { 0, 0 }
}

Definition at line 99 of file kkeyserver_x11.cpp.

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 90 of file kkeyserver_x11.cpp.

const int KKeyServer::MODE_SWITCH = 0x2000 [static]

Definition at line 32 of file kkeyserver_x11.h.

KDEUI

Skip menu "KDEUI"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • KIO
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • Kross
  • KUtils
  • Nepomuk
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal