Skip to content
Skip to link menu
Trinity API Reference
Trinity API Reference
kdecore
kdecore
kdecore
kkeynative.h
1
/* This file is part of the KDE libraries
2
Copyright (C) 2002 Ellis Whitehead <ellis@kde.org>
3
4
Win32 port:
5
Copyright (C) 2004 Jaroslaw Staniek <js@iidea.pl>
6
7
This library is free software; you can redistribute it and/or
8
modify it under the terms of the GNU Library General Public
9
License as published by the Free Software Foundation; either
10
version 2 of the License, or (at your option) any later version.
11
12
This library is distributed in the hope that it will be useful,
13
but WITHOUT ANY WARRANTY; without even the implied warranty of
14
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15
Library General Public License for more details.
16
17
You should have received a copy of the GNU Library General Public License
18
along with this library; see the file COPYING.LIB. If not, write to
19
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20
Boston, MA 02110-1301, USA.
21
*/
22
23
#ifndef __KKEYNATIVE_H
24
#define __KKEYNATIVE_H
25
26
#include <kshortcut.h>
27
28
#ifdef Q_WS_X11
29
typedef
union
_XEvent XEvent;
30
#endif
31
32
class
KKeyNativePrivate;
37
class
KDECORE_EXPORT
KKeyNative
38
{
39
public
:
46
KKeyNative
();
47
48
#ifdef Q_WS_X11
49
53
KKeyNative
(
const
XEvent* xevent );
54
#endif
55
60
KKeyNative
(
const
KKey
& key );
61
65
KKeyNative
(
const
KKeyNative
& );
66
70
KKeyNative
( uint code, uint mod, uint sym );
71
~
KKeyNative
();
72
77
void
clear();
78
79
#ifdef Q_WS_X11
80
86
bool
init(
const
XEvent* xevent );
87
#endif
88
94
bool
init(
const
KKey
& key );
95
101
bool
init(
const
KKeyNative
& key );
102
108
KKeyNative
& operator =(
const
KKeyNative
& key )
109
{ init( key );
return
*
this
; }
110
117
int
keyCodeQt()
const
;
118
123
KKey
key()
const
;
124
130
operator
KKey
()
const
{
return
key(); }
131
136
uint code()
const
;
137
142
uint mod()
const
;
143
148
uint sym()
const
;
149
157
bool
isNull()
const
;
158
170
int
compare(
const
KKeyNative
& key )
const
;
171
176
bool
operator == (
const
KKeyNative
& key )
const
177
{
return
compare( key ) == 0; }
178
183
bool
operator != (
const
KKeyNative
& key )
const
184
{
return
compare( key ) != 0; }
185
190
bool
operator < (
const
KKeyNative
& key )
const
191
{
return
compare( key ) < 0; }
192
199
static
KKeyNative
& null();
200
201
// General query functions. //
206
static
bool
keyboardHasWinKey();
207
208
#ifdef Q_WS_X11
209
214
static
uint modX(
KKey::ModFlag
modFlag );
215
221
static
uint accelModMaskX();
222
228
static
uint modXNumLock();
229
235
static
uint modXLock();
236
242
static
uint modXScrollLock();
243
250
static
uint modXModeSwitch();
251
#endif
252
253
private
:
254
uint m_code, m_mod, m_sym;
255
KKeyNativePrivate* d;
256
};
257
258
#endif // !__KKEYNATIVE_H
kdecore
Skip menu "kdecore"
Main Page
Modules
Namespace List
Class Hierarchy
Alphabetical List
Class List
File List
Namespace Members
Class Members
Related Pages
kdecore
Skip menu "kdecore"
arts
dcop
dnssd
interfaces
interface
library
kspeech
ktexteditor
kabc
kate
kcmshell
kdecore
kded
kdefx
kdeprint
kdesu
kdeui
kdoctools
khtml
kimgio
kinit
kio
bookmarks
httpfilter
kfile
kio
kioexec
kpasswdserver
kssl
kioslave
http
kjs
kmdi
kmdi
knewstuff
kparts
krandr
kresources
kspell2
kunittest
kutils
kwallet
libkmid
libkscreensaver