AntiMicroX
qtx11keymapper.h
Go to the documentation of this file.
1 /* antimicrox Gamepad to KB+M event mapper
2  * Copyright (C) 2015 Travis Nickles <nickles.travis@gmail.com>
3  * Copyright (C) 2020 Jagoda Górska <juliagoda.pl@protonmail>
4  *
5  * This program is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation, either version 3 of the License, or
8  * (at your option) any later version.
9 
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14 
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  */
18 
19 #ifndef QTX11KEYMAPPER_H
20 #define QTX11KEYMAPPER_H
21 
22 #include "qtkeymapperbase.h"
23 
25 {
26  Q_OBJECT
27 
28  public:
29  explicit QtX11KeyMapper(QObject *parent = nullptr);
30 
31  protected:
32  void populateMappingHashes() override;
33  void populateCharKeyInformation() override;
34 
35  private:
36  void mapMiscKeysQtX11(QHash<int, int> &qtKeyToVirtKeyHash);
37  void mapCursorMovesKeysQtX11(QHash<int, int> &qtKeyToVirtKeyHash);
38  void mapModifiersKeysQtX11(QHash<int, int> &qtKeyToVirtKeyHash);
39  void mapAdditionalKeysQtX11(QHash<int, int> &qtKeyToVirtKeyHash);
40  void mapKeypadKeysQtX11(QHash<int, int> &qtKeyToVirtKeyHash);
41  void mapInternationKeysQtX11(QHash<int, int> &qtKeyToVirtKeyHash);
42  void mapJapanKeysQtX11(QHash<int, int> &qtKeyToVirtKeyHash);
43  void mapKoreanKeysQtX11(QHash<int, int> &qtKeyToVirtKeyHash);
44  void mapDeadKeysQtX11(QHash<int, int> &qtKeyToVirtKeyHash);
45  void mapBrowseKeysQtX11(QHash<int, int> &qtKeyToVirtKeyHash);
46  void mapMediaKeysQtX11(QHash<int, int> &qtKeyToVirtKeyHash);
47  void mapLaunchKeysQtX11(QHash<int, int> &qtKeyToVirtKeyHash);
48 };
49 
50 #endif // QTX11KEYMAPPER_H
QtKeyMapperBase::AntKey_Meta_R
@ AntKey_Meta_R
Definition: qtkeymapperbase.h:53
x11extras.h
QtX11KeyMapper::mapJapanKeysQtX11
void mapJapanKeysQtX11(QHash< int, int > &qtKeyToVirtKeyHash)
Definition: qtx11keymapper.cpp:296
QtKeyMapperBase::AntKey_Shift_R
@ AntKey_Shift_R
Definition: qtkeymapperbase.h:50
QtKeyMapperBase::AntKey_KP_Add
@ AntKey_KP_Add
Definition: qtkeymapperbase.h:58
QtKeyMapperBase::AntKey_KP_Divide
@ AntKey_KP_Divide
Definition: qtkeymapperbase.h:55
QtKeyMapperBase::AntKey_KP_Insert
@ AntKey_KP_Insert
Definition: qtkeymapperbase.h:60
QtKeyMapperBase::AntKey_KP_7
@ AntKey_KP_7
Definition: qtkeymapperbase.h:80
QtKeyMapperBase::AntKey_KP_Home
@ AntKey_KP_Home
Definition: qtkeymapperbase.h:69
QtKeyMapperBase::AntKey_KP_5
@ AntKey_KP_5
Definition: qtkeymapperbase.h:78
QtKeyMapperBase::AntKey_KP_Subtract
@ AntKey_KP_Subtract
Definition: qtkeymapperbase.h:57
QtKeyMapperBase::AntKey_KP_Begin
@ AntKey_KP_Begin
Definition: qtkeymapperbase.h:67
QtKeyMapperBase::AntKey_KP_Down
@ AntKey_KP_Down
Definition: qtkeymapperbase.h:64
QtKeyMapperBase::virtkeyToCharKeyInfo
QHash< int, charKeyInformation > virtkeyToCharKeyInfo
Definition: qtkeymapperbase.h:91
QtKeyMapperBase::AntKey_KP_3
@ AntKey_KP_3
Definition: qtkeymapperbase.h:76
QtKeyMapperBase::AntKey_KP_9
@ AntKey_KP_9
Definition: qtkeymapperbase.h:82
QtKeyMapperBase::AntKey_Alt_R
@ AntKey_Alt_R
Definition: qtkeymapperbase.h:54
QtKeyMapperBase::AntKey_KP_0
@ AntKey_KP_0
Definition: qtkeymapperbase.h:73
X11Extras::display
Display * display()
Get display instance.
Definition: x11extras.cpp:117
QtX11KeyMapper::mapMediaKeysQtX11
void mapMediaKeysQtX11(QHash< int, int > &qtKeyToVirtKeyHash)
Definition: qtx11keymapper.cpp:376
QtKeyMapperBase::AntKey_KP_Multiply
@ AntKey_KP_Multiply
Definition: qtkeymapperbase.h:56
QtKeyMapperBase::virtKeyToQtKeyHash
QHash< int, int > virtKeyToQtKeyHash
Definition: qtkeymapperbase.h:90
QtKeyMapperBase::AntKey_KP_8
@ AntKey_KP_8
Definition: qtkeymapperbase.h:81
QtKeyMapperBase::AntKey_KP_Left
@ AntKey_KP_Left
Definition: qtkeymapperbase.h:66
QtX11KeyMapper::mapCursorMovesKeysQtX11
void mapCursorMovesKeysQtX11(QHash< int, int > &qtKeyToVirtKeyHash)
Definition: qtx11keymapper.cpp:211
QtKeyMapperBase::AntKey_KP_Next
@ AntKey_KP_Next
Definition: qtkeymapperbase.h:71
QtX11KeyMapper::mapBrowseKeysQtX11
void mapBrowseKeysQtX11(QHash< int, int > &qtKeyToVirtKeyHash)
Definition: qtx11keymapper.cpp:363
QtX11KeyMapper::mapMiscKeysQtX11
void mapMiscKeysQtX11(QHash< int, int > &qtKeyToVirtKeyHash)
Definition: qtx11keymapper.cpp:197
QtKeyMapperBase::identifier
QString identifier
Definition: qtkeymapperbase.h:92
QtX11KeyMapper::mapKeypadKeysQtX11
void mapKeypadKeysQtX11(QHash< int, int > &qtKeyToVirtKeyHash)
Definition: qtx11keymapper.cpp:251
QtX11KeyMapper::mapAdditionalKeysQtX11
void mapAdditionalKeysQtX11(QHash< int, int > &qtKeyToVirtKeyHash)
Definition: qtx11keymapper.cpp:236
QtKeyMapperBase::AntKey_KP_6
@ AntKey_KP_6
Definition: qtkeymapperbase.h:79
QtX11KeyMapper::QtX11KeyMapper
QtX11KeyMapper(QObject *parent=nullptr)
Definition: qtx11keymapper.cpp:39
QtKeyMapperBase::AntKey_KP_End
@ AntKey_KP_End
Definition: qtkeymapperbase.h:63
QtKeyMapperBase
Definition: qtkeymapperbase.h:25
QtKeyMapperBase::AntKey_KP_Right
@ AntKey_KP_Right
Definition: qtkeymapperbase.h:68
QtKeyMapperBase::AntKey_Control_R
@ AntKey_Control_R
Definition: qtkeymapperbase.h:51
QtKeyMapperBase::AntKey_KP_Decimal
@ AntKey_KP_Decimal
Definition: qtkeymapperbase.h:59
qtkeymapperbase.h
QtKeyMapperBase::AntKey_KP_2
@ AntKey_KP_2
Definition: qtkeymapperbase.h:75
QtX11KeyMapper::mapModifiersKeysQtX11
void mapModifiersKeysQtX11(QHash< int, int > &qtKeyToVirtKeyHash)
Definition: qtx11keymapper.cpp:223
X11Extras::getInstance
static X11Extras * getInstance()
Definition: x11extras.cpp:73
qtx11keymapper.h
QtKeyMapperBase::qtKeyToVirtKeyHash
QHash< int, int > qtKeyToVirtKeyHash
Definition: qtkeymapperbase.h:89
QtKeyMapperBase::AntKey_KP_Enter
@ AntKey_KP_Enter
Definition: qtkeymapperbase.h:72
QtKeyMapperBase::AntKey_KP_1
@ AntKey_KP_1
Definition: qtkeymapperbase.h:74
QtX11KeyMapper::mapInternationKeysQtX11
void mapInternationKeysQtX11(QHash< int, int > &qtKeyToVirtKeyHash)
Definition: qtx11keymapper.cpp:286
QtX11KeyMapper::mapLaunchKeysQtX11
void mapLaunchKeysQtX11(QHash< int, int > &qtKeyToVirtKeyHash)
Definition: qtx11keymapper.cpp:388
QtKeyMapperBase::AntKey_KP_4
@ AntKey_KP_4
Definition: qtkeymapperbase.h:77
QtX11KeyMapper::populateCharKeyInformation
void populateCharKeyInformation() override
Definition: qtx11keymapper.cpp:131
QtKeyMapperBase::AntKey_KP_Up
@ AntKey_KP_Up
Definition: qtkeymapperbase.h:70
QtKeyMapperBase::_charKeyInformation::virtualkey
int virtualkey
Definition: qtkeymapperbase.h:35
QtKeyMapperBase::AntKey_KP_Prior
@ AntKey_KP_Prior
Definition: qtkeymapperbase.h:65
QtX11KeyMapper::mapKoreanKeysQtX11
void mapKoreanKeysQtX11(QHash< int, int > &qtKeyToVirtKeyHash)
Definition: qtx11keymapper.cpp:320
QtX11KeyMapper::mapDeadKeysQtX11
void mapDeadKeysQtX11(QHash< int, int > &qtKeyToVirtKeyHash)
Definition: qtx11keymapper.cpp:340
QtX11KeyMapper::populateMappingHashes
void populateMappingHashes() override
Definition: qtx11keymapper.cpp:53
QtKeyMapperBase::_charKeyInformation::modifiers
Qt::KeyboardModifiers modifiers
Definition: qtkeymapperbase.h:34
QtKeyMapperBase::_charKeyInformation
Definition: qtkeymapperbase.h:32
QtKeyMapperBase::AntKey_KP_Delete
@ AntKey_KP_Delete
Definition: qtkeymapperbase.h:62
QtX11KeyMapper
Definition: qtx11keymapper.h:24