• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdecore
 

tdecore

  • tdecore
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 <tdeshortcut.h>
27
28#ifdef TQ_WS_X11
29typedef union _XEvent XEvent;
30#endif
31
32class KKeyNativePrivate;
37class TDECORE_EXPORT KKeyNative
38{
39 public:
46 KKeyNative();
47
48#ifdef TQ_WS_X11
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 TQ_WS_X11
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 TQ_WS_X11
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
KKeyNative
Representation of a key in the format native of the windowing system (eg.
Definition: kkeynative.h:38
KKeyNative::clear
void clear()
Clears the key.
KKeyNative::compare
int compare(const KKeyNative &key) const
Compares this key with the given KKeyNative object.
KKeyNative::KKeyNative
KKeyNative(const KKeyNative &)
Copy constructor.
KKeyNative::keyCodeQt
int keyCodeQt() const
Returns the qt key code.
KKeyNative::isNull
bool isNull() const
Returns true if the key is null (after clear() or empty constructor).
KKeyNative::key
KKey key() const
Returns the KKey representation of this key.
KKeyNative::mod
uint mod() const
The native modifier flags of the key.
KKeyNative::code
uint code() const
The native keycode of the key.
KKeyNative::sym
uint sym() const
The native symbol (KeySym) of the key.
KKeyNative::null
static KKeyNative & null()
Returns a null key.
KKeyNative::KKeyNative
KKeyNative(const KKey &key)
Creates a new native key for the given KKey code.
KKeyNative::init
bool init(const KKey &key)
Creates a new native key for the given KKey code.
KKeyNative::init
bool init(const KKeyNative &key)
Copies the given key into this key.
KKeyNative::KKeyNative
KKeyNative()
Creates a new null KKey.
KKeyNative::keyboardHasWinKey
static bool keyboardHasWinKey()
Checks whether the keyboard has a Win key.
KKey
A KKey object represents a single key with possible modifiers (Shift, Ctrl, Alt, Win).
Definition: tdeshortcut.h:41
KKey::ModFlag
ModFlag
Flags to represent the modifiers.
Definition: tdeshortcut.h:53

tdecore

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

tdecore

Skip menu "tdecore"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdecore by doxygen 1.9.4
This website is maintained by Timothy Pearson.