KWindowSystem

kkeyserver.h
1 /*
2  SPDX-FileCopyrightText: 2001 Ellis Whitehead <[email protected]>
3 
4  Win32 port:
5  SPDX-FileCopyrightText: 2004 JarosÅ‚aw Staniek <[email protected]>
6 
7  SPDX-License-Identifier: LGPL-2.1-or-later
8 */
9 
10 #ifndef _KKEYSERVER_H
11 #define _KKEYSERVER_H
12 
13 #include <kwindowsystem_export.h>
14 
15 #include <qglobal.h>
16 
17 #include <config-kwindowsystem.h>
18 #if KWINDOWSYSTEM_HAVE_X11 /*or defined Q_OS_WIN*/
19 #include "kkeyserver_x11.h"
20 #elif defined Q_OS_MAC
21 #include "kkeyserver_mac.h"
22 #elif defined Q_OS_WIN
23 #include "kkeyserver_win.h"
24 #endif
25 
26 class QString;
27 
28 /**
29  * A collection of functions for the conversion of key presses and
30  * their modifiers from the window system specific format
31  * to the generic format and vice-versa.
32  */
33 namespace KKeyServer
34 {
35 /**
36  * Converts the mask of ORed KKey::ModFlag modifiers to a
37  * user-readable string.
38  * @param mod the mask of ORed KKey::ModFlag modifiers
39  * @return the user-readable string (in English)
40  */
41 KWINDOWSYSTEM_EXPORT QString modToStringUser(uint mod);
42 
43 /**
44  * Converts the modifier given as user-readable string (in English)
45  * to KKey::ModFlag modifier, or 0.
46  * @internal
47  */
48 KWINDOWSYSTEM_EXPORT uint stringUserToMod(const QString &mod);
49 
50 /**
51  * Test if the shift modifier should be recorded for a given key.
52  *
53  * For example, if shift+5 produces '%' Qt wants ctrl+shift+5 recorded as ctrl+% and
54  * in that case this function would return false.
55  *
56  * @since 4.7.1
57  */
58 KWINDOWSYSTEM_EXPORT bool isShiftAsModifierAllowed(int keyQt);
59 
60 } // namespace KKeyServer
61 
62 #endif // !_KKEYSERVER_H
QString modToStringUser(uint mod)
Converts the mask of ORed KKey::ModFlag modifiers to a user-readable string.
Definition: kkeyserver.cpp:78
A collection of functions for the conversion of key presses and their modifiers from the window syste...
Definition: kkeyserver.cpp:14
bool isShiftAsModifierAllowed(int keyQt)
Test if the shift modifier should be recorded for a given key.
Definition: kkeyserver.cpp:93
uint stringUserToMod(const QString &mod)
Converts the modifier given as user-readable string (in English) to KKey::ModFlag modifier...
Definition: kkeyserver.cpp:83
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Fri Oct 15 2021 22:41:49 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.