AntiMicroX
qtuinputkeymapper.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 QTUINPUTKEYMAPPER_H
20 #define QTUINPUTKEYMAPPER_H
21 
22 #include "qtkeymapperbase.h"
23 
25 {
26  Q_OBJECT
27 
28  public:
29  explicit QtUInputKeyMapper(QObject *parent = nullptr);
30 
31  protected:
32  void populateMappingHashes() override;
33  void populateCharKeyInformation() override;
34 
35  void populateAlphaHashes();
36  void populateFKeyHashes();
37  void populateNumPadHashes();
39 
40  private:
41  void addVirtualKeyToHash(int key, QChar character, charKeyInformation &charKeyInfo);
42  void mapMiscKeysQtUinput(QHash<int, int> &qtKeyToVirtKeyHash);
43  void mapCursorMovesKeysQtUinput(QHash<int, int> &qtKeyToVirtKeyHash);
44  void mapModifiersKeysQtUinput(QHash<int, int> &qtKeyToVirtKeyHash);
45  void mapKeypadKeysQtUinput(QHash<int, int> &qtKeyToVirtKeyHash);
46  void mapJapanKeysQtUinput(QHash<int, int> &qtKeyToVirtKeyHash);
47  void mapKoreanKeysQtUinput(QHash<int, int> &qtKeyToVirtKeyHash);
48  void mapMediaKeysQtUinput(QHash<int, int> &qtKeyToVirtKeyHash);
49 };
50 
51 #endif // QTUINPUTKEYMAPPER_H
QtKeyMapperBase::AntKey_Meta_R
@ AntKey_Meta_R
Definition: qtkeymapperbase.h:53
QtKeyMapperBase::AntKey_Shift_R
@ AntKey_Shift_R
Definition: qtkeymapperbase.h:50
qtuinputkeymapper.h
QtKeyMapperBase::AntKey_KP_Add
@ AntKey_KP_Add
Definition: qtkeymapperbase.h:58
QtUInputKeyMapper::mapMiscKeysQtUinput
void mapMiscKeysQtUinput(QHash< int, int > &qtKeyToVirtKeyHash)
Definition: qtuinputkeymapper.cpp:300
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
QtUInputKeyMapper
Definition: qtuinputkeymapper.h:24
QtKeyMapperBase::AntKey_Alt_R
@ AntKey_Alt_R
Definition: qtkeymapperbase.h:54
QtUInputKeyMapper::mapMediaKeysQtUinput
void mapMediaKeysQtUinput(QHash< int, int > &qtKeyToVirtKeyHash)
Definition: qtuinputkeymapper.cpp:452
QtKeyMapperBase::AntKey_KP_0
@ AntKey_KP_0
Definition: qtkeymapperbase.h:73
QtUInputKeyMapper::mapCursorMovesKeysQtUinput
void mapCursorMovesKeysQtUinput(QHash< int, int > &qtKeyToVirtKeyHash)
Definition: qtuinputkeymapper.cpp:353
QtUInputKeyMapper::populateNumPadHashes
void populateNumPadHashes()
Definition: qtuinputkeymapper.cpp:84
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
QtUInputKeyMapper::addVirtualKeyToHash
void addVirtualKeyToHash(int key, QChar character, charKeyInformation &charKeyInfo)
Definition: qtuinputkeymapper.cpp:294
QtKeyMapperBase::AntKey_KP_Left
@ AntKey_KP_Left
Definition: qtkeymapperbase.h:66
QtUInputKeyMapper::populateFKeyHashes
void populateFKeyHashes()
Definition: qtuinputkeymapper.cpp:69
QtKeyMapperBase::AntKey_KP_Next
@ AntKey_KP_Next
Definition: qtkeymapperbase.h:71
QtUInputKeyMapper::mapModifiersKeysQtUinput
void mapModifiersKeysQtUinput(QHash< int, int > &qtKeyToVirtKeyHash)
Definition: qtuinputkeymapper.cpp:365
QtUInputKeyMapper::populateAlphaHashes
void populateAlphaHashes()
Definition: qtuinputkeymapper.cpp:38
QtKeyMapperBase::identifier
QString identifier
Definition: qtkeymapperbase.h:92
QtKeyMapperBase::AntKey_KP_6
@ AntKey_KP_6
Definition: qtkeymapperbase.h:79
QtUInputKeyMapper::QtUInputKeyMapper
QtUInputKeyMapper(QObject *parent=nullptr)
Definition: qtuinputkeymapper.cpp:30
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
QtUInputKeyMapper::populateCharKeyInformation
void populateCharKeyInformation() override
Definition: qtuinputkeymapper.cpp:180
QtUInputKeyMapper::populateMappingHashes
void populateMappingHashes() override
Definition: qtuinputkeymapper.cpp:117
QtKeyMapperBase::AntKey_KP_Decimal
@ AntKey_KP_Decimal
Definition: qtkeymapperbase.h:59
qtkeymapperbase.h
QtUInputKeyMapper::mapJapanKeysQtUinput
void mapJapanKeysQtUinput(QHash< int, int > &qtKeyToVirtKeyHash)
Definition: qtuinputkeymapper.cpp:409
QtKeyMapperBase::AntKey_KP_2
@ AntKey_KP_2
Definition: qtkeymapperbase.h:75
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
QtUInputKeyMapper::mapKoreanKeysQtUinput
void mapKoreanKeysQtUinput(QHash< int, int > &qtKeyToVirtKeyHash)
Definition: qtuinputkeymapper.cpp:432
QtKeyMapperBase::AntKey_KP_4
@ AntKey_KP_4
Definition: qtkeymapperbase.h:77
QtUInputKeyMapper::mapKeypadKeysQtUinput
void mapKeypadKeysQtUinput(QHash< int, int > &qtKeyToVirtKeyHash)
Definition: qtuinputkeymapper.cpp:379
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
QtUInputKeyMapper::populateSpecialCharHashes
void populateSpecialCharHashes()
Definition: qtuinputkeymapper.cpp:102
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