kdecore Library API Documentation

KKeyNative Class Reference

Representation of a key in the format native of the windowing system (eg. More...

#include <kkeynative.h>

List of all members.

Public Member Functions

 KKeyNative ()
 KKeyNative (const XEvent *xevent)
 KKeyNative (const KKey &key)
 KKeyNative (const KKeyNative &)
 KKeyNative (uint code, uint mod, uint sym)
 ~KKeyNative ()
void clear ()
bool init (const XEvent *xevent)
bool init (const KKey &key)
bool init (const KKeyNative &key)
KKeyNativeoperator= (const KKeyNative &key)
int keyCodeQt () const
KKey key () const
 operator KKey () const
uint code () const
uint mod () const
uint sym () const
bool isNull () const
int compare (const KKeyNative &key) const
bool operator== (const KKeyNative &key) const
bool operator!= (const KKeyNative &key) const
bool operator< (const KKeyNative &key) const

Static Public Member Functions

static KKeyNativenull ()
static bool keyboardHasWinKey ()
static uint modX (KKey::ModFlag modFlag)
static uint accelModMaskX ()
static uint modXNumLock ()
static uint modXLock ()
static uint modXScrollLock ()
static uint modXModeSwitch ()


Detailed Description

Representation of a key in the format native of the windowing system (eg.

X11).

See also:
KKey

Definition at line 37 of file kkeynative.h.


Constructor & Destructor Documentation

KKeyNative::KKeyNative  ) 
 

Creates a new null KKey.

See also:
clear()

isNull()

null()

Definition at line 55 of file kkeynative_x11.cpp.

References clear().

KKeyNative::KKeyNative const XEvent *  xevent  ) 
 

Extracts a new native key from the given xevent.

Parameters:
xevent the XEvent that contains the key

Definition at line 59 of file kkeynative_x11.cpp.

References init().

KKeyNative::KKeyNative const KKey key  ) 
 

Creates a new native key for the given KKey code.

Parameters:
key the KKey that contains the generic key

Definition at line 56 of file kkeynative_x11.cpp.

References init().

KKeyNative::KKeyNative const KKeyNative  ) 
 

Copy constructor.

Definition at line 57 of file kkeynative_x11.cpp.

References init().


Member Function Documentation

void KKeyNative::clear  ) 
 

Clears the key.

The key is null after calling this function.

See also:
isNull()

Definition at line 72 of file kkeynative_x11.cpp.

Referenced by KKeyNative(), and null().

bool KKeyNative::init const XEvent *  xevent  ) 
 

Initializes the native key by extracting the information from the given xevent.

Parameters:
xevent the XEvent that contains the key
Returns:
true if successful, false otherwise

Definition at line 80 of file kkeynative_x11.cpp.

Referenced by KKeyNative().

bool KKeyNative::init const KKey key  ) 
 

Creates a new native key for the given KKey code.

Parameters:
key the KKey that contains the generic key
Returns:
true if successful, false otherwise

Definition at line 91 of file kkeynative_x11.cpp.

References KKeyServer::codeXToSym(), endl(), kdDebug(), KKey::m_mod, KKey::modFlags(), KKeyServer::modToModX(), and KKey::sym().

bool KKeyNative::init const KKeyNative key  ) 
 

Copies the given key into this key.

Parameters:
key the key to copy
Returns:
true if successful, false otherwise

Definition at line 130 of file kkeynative_x11.cpp.

References m_code, m_mod, and m_sym.

KKeyNative& KKeyNative::operator= const KKeyNative key  )  [inline]
 

Copies the given key into this key.

Parameters:
key the key to copy
Returns:
this key

Definition at line 108 of file kkeynative.h.

int KKeyNative::keyCodeQt  )  const
 

Returns the qt key code.

Returns:
the qt key code or 0 if there is no key set.
See also:
Qt::Key

Definition at line 177 of file kkeynative_x11.cpp.

References KKeyServer::modXToModQt().

Referenced by KShortcut::operator int().

KKey KKeyNative::key  )  const
 

Returns the KKey representation of this key.

Returns:
the KKey representation

Definition at line 164 of file kkeynative_x11.cpp.

References KKeyServer::modXToMod().

Referenced by KShortcut::contains().

KKeyNative::operator KKey  )  const [inline]
 

Converts this key to its KKey representation.

Returns:
the KKey representation
See also:
key()

Definition at line 130 of file kkeynative.h.

uint KKeyNative::code  )  const
 

The native keycode of the key.

Returns:
the native keycode

Definition at line 138 of file kkeynative_x11.cpp.

uint KKeyNative::mod  )  const
 

The native modifier flags of the key.

Returns:
the native modifier flags

Definition at line 139 of file kkeynative_x11.cpp.

uint KKeyNative::sym  )  const
 

The native symbol (KeySym) of the key.

Returns:
the native symbol (KeySym)

Definition at line 140 of file kkeynative_x11.cpp.

bool KKeyNative::isNull  )  const
 

Returns true if the key is null (after clear() or empty constructor).

Returns:
true if the key is null
See also:
clear()

null()

Definition at line 142 of file kkeynative_x11.cpp.

Referenced by null().

int KKeyNative::compare const KKeyNative key  )  const
 

Compares this key with the given KKeyNative object.

Returns a negative number if the given KKeyNative is larger, 0 if they are equal and a positive number this KKeyNative is larger. The returned value is the difference between the symbol, modifier or code, whatever is non-zero first.

Parameters:
key the key to compare with this key
Returns:
a negative number if the given KKeyNative is larger, 0 if they are equal and a positive number this KKeyNative is larger

Definition at line 147 of file kkeynative_x11.cpp.

References m_code, m_mod, and m_sym.

bool KKeyNative::operator== const KKeyNative key  )  const [inline]
 

Compares the symbol, modifiers and code of both keys.

See also:
compare()

Definition at line 176 of file kkeynative.h.

bool KKeyNative::operator!= const KKeyNative key  )  const [inline]
 

Compares the symbol, modifiers and code of both keys.

See also:
compare()

Definition at line 183 of file kkeynative.h.

bool KKeyNative::operator< const KKeyNative key  )  const [inline]
 

Compares the symbol, modifiers and code of both keys.

See also:
compare()

Definition at line 190 of file kkeynative.h.

KKeyNative & KKeyNative::null  )  [static]
 

Returns a null key.

Returns:
the null key
See also:
isNull()

clear()

Definition at line 155 of file kkeynative_x11.cpp.

References clear(), and isNull().

bool KKeyNative::keyboardHasWinKey  )  [static]
 

Checks whether the keyboard has a Win key.

Returns:
true if the keyboard has a Win key

Definition at line 187 of file kkeynative_x11.cpp.

References KKeyServer::keyboardHasWinKey().

Referenced by KAccelAction::useFourModifierKeys().

uint KKeyNative::modX KKey::ModFlag  modFlag  )  [static]
 

Returns the equivalent X modifier mask of the given modifier flag.

Parameters:
modFlag the mod flags to test
Returns:
the equivalent native flags of the window system

Definition at line 190 of file kkeynative_x11.cpp.

References KKeyServer::modX().

Referenced by KApplication::keyboardMouseState().

uint KKeyNative::accelModMaskX  )  [static]
 

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

Returns:
the mask of Shift, Ctrl, Alt and Win.

Definition at line 191 of file kkeynative_x11.cpp.

References KKeyServer::accelModMaskX().

uint KKeyNative::modXNumLock  )  [static]
 

Returns the X11 NumLock modifier mask/flag.

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

Definition at line 192 of file kkeynative_x11.cpp.

References KKeyServer::modXNumLock().

uint KKeyNative::modXLock  )  [static]
 

Returns the X11 Lock modifier mask/flag.

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

Definition at line 193 of file kkeynative_x11.cpp.

References KKeyServer::modXLock().

uint KKeyNative::modXScrollLock  )  [static]
 

Returns the X11 ScrollLock modifier mask/flag.

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

Definition at line 194 of file kkeynative_x11.cpp.

References KKeyServer::modXScrollLock().

uint KKeyNative::modXModeSwitch  )  [static]
 

Returns the X11 Mode_switch modifier mask/flag.

Returns:
the X11 Mode_switch modifier mask/flag.
See also:
accelModMaskX()
Since:
3.5

Definition at line 195 of file kkeynative_x11.cpp.

References KKeyServer::modXModeSwitch().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for kdecore Library Version 3.4.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Mon Jun 12 11:28:51 2006 by doxygen 1.4.4 written by Dimitri van Heesch, © 1997-2003