00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
#ifndef __KKEYNATIVE_H
00024
#define __KKEYNATIVE_H
00025
00026
#include <kshortcut.h>
00027
00028
#ifdef Q_WS_X11
00029
typedef union _XEvent XEvent;
00030
#endif
00031
00032
class KKeyNativePrivate;
00037 class KDECORE_EXPORT KKeyNative
00038 {
00039
public:
00046 KKeyNative();
00047
00048
#ifdef Q_WS_X11
00049
00053 KKeyNative(
const XEvent* xevent );
00054
#endif
00055
00060 KKeyNative(
const KKey& key );
00061
00065 KKeyNative(
const KKeyNative& );
00066
00070 KKeyNative( uint code, uint mod, uint sym );
00071 ~KKeyNative();
00072
00077
void clear();
00078
00079
#ifdef Q_WS_X11
00080
00086
bool init(
const XEvent* xevent );
00087
#endif
00088
00094
bool init(
const KKey& key );
00095
00101
bool init(
const KKeyNative& key );
00102
00108 KKeyNative& operator =(
const KKeyNative& key )
00109 { init( key );
return *
this; }
00110
00117
int keyCodeQt() const;
00118
00123
KKey key() const;
00124
00130 operator
KKey()
const {
return key(); }
00131
00136 uint code() const;
00137
00142 uint mod() const;
00143
00148 uint sym() const;
00149
00157
bool isNull() const;
00158
00170
int compare( const KKeyNative& key ) const;
00171
00176 bool operator == ( const KKeyNative& key )
const
00177
{
return compare( key ) == 0; }
00178
00183 bool operator != (
const KKeyNative& key )
const
00184
{
return compare( key ) != 0; }
00185
00190 bool operator < (
const KKeyNative& key )
const
00191
{
return compare( key ) < 0; }
00192
00199
static KKeyNative& null();
00200
00201
00206
static bool keyboardHasWinKey();
00207
00208
#ifdef Q_WS_X11
00209
00214
static uint modX( KKey::ModFlag modFlag );
00215
00221
static uint accelModMaskX();
00222
00228
static uint modXNumLock();
00229
00235
static uint modXLock();
00236
00242
static uint modXScrollLock();
00243
00250
static uint modXModeSwitch();
00251
#endif
00252
00253
private:
00254 uint m_code, m_mod, m_sym;
00255 KKeyNativePrivate* d;
00256 };
00257
00258
#endif // !__KKEYNATIVE_H