summaryrefslogtreecommitdiff
path: root/src/plugins/platforms/openkode/openkodekeytranslator.h
blob: a6f87e2e5b3e5422c686b5f6a6521eec985d7826 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the plugins of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see http://www.qt.io/terms-conditions. For further
** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 or version 3 as published by the Free
** Software Foundation and appearing in the file LICENSE.LGPLv21 and
** LICENSE.LGPLv3 included in the packaging of this file. Please review the
** following information to ensure the GNU Lesser General Public License
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** As a special exception, The Qt Company gives you certain additional
** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.  Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/

#ifndef OPENKODEKEYTRANSLATOR_H
#define OPENKODEKEYTRANSLATOR_H

#ifdef KD_ATX_keyboard

#include <KD/ATX_keyboard.h>

QT_BEGIN_NAMESPACE

Qt::Key keyTranslator( int key )
{
    switch (key) {
// KD_KEY_ACCEPT_ATX:
// KD_KEY_AGAIN_ATX:
// KD_KEY_ALLCANDIDATES_ATX
// KD_KEY_ALPHANUMERIC_ATX
    case KD_KEY_ALT_ATX:
        return Qt::Key_Alt;
    case KD_KEY_ALTGRAPH_ATX:
        return Qt::Key_AltGr;
// KD_KEY_APPS_ATX
// KD_KEY_ATTN_ATX
// KD_KEY_BROWSERBACK_ATX
// KD_KEY_BROWSERFAVORITES_ATX
// KD_KEY_BROWSERFORWARD_ATX
// KD_KEY_BROWSERHOME_ATX
// KD_KEY_BROWSERREFRESH_ATX
// KD_KEY_BROWSERSEARCH_ATX
// KD_KEY_BROWSERSTOP_ATX
    case KD_KEY_CAPSLOCK_ATX:
        return Qt::Key_CapsLock;
    case KD_KEY_CLEAR_ATX:
        return Qt::Key_Clear;
    case KD_KEY_CODEINPUT_ATX:
        return Qt::Key_Codeinput;
// KD_KEY_COMPOSE_ATX
    case KD_KEY_CONTROL_ATX:
        return Qt::Key_Control;
// KD_KEY_CRSEL_ATX
// KD_KEY_CONVERT_ATX
    case KD_KEY_COPY_ATX:
        return Qt::Key_Copy;
    case KD_KEY_CUT_ATX:
        return Qt::Key_Cut;
    case KD_KEY_DOWN_ATX:
        return Qt::Key_Down;
    case KD_KEY_END_ATX:
        return Qt::Key_End;
    case KD_KEY_ENTER_ATX:
        return Qt::Key_Enter;
// KD_KEY_ERASEEOF_ATX
// KD_KEY_EXECUTE_ATX
// KD_KEY_EXSEL_ATX
    case KD_KEY_F1_ATX:
        return Qt::Key_F1;
    case KD_KEY_F2_ATX:
        return Qt::Key_F2;
    case KD_KEY_F3_ATX:
        return Qt::Key_F3;
    case KD_KEY_F4_ATX:
        return Qt::Key_F4;
    case KD_KEY_F5_ATX:
        return Qt::Key_F5;
    case KD_KEY_F6_ATX:
        return Qt::Key_F6;
    case KD_KEY_F7_ATX:
        return Qt::Key_F7;
    case KD_KEY_F8_ATX:
        return Qt::Key_F8;
    case KD_KEY_F9_ATX:
        return Qt::Key_F9;
    case KD_KEY_F10_ATX:
        return Qt::Key_F10;
    case KD_KEY_F11_ATX:
        return Qt::Key_F11;
    case KD_KEY_F12_ATX:
        return Qt::Key_F12;
    case KD_KEY_F13_ATX:
        return Qt::Key_F13;
    case KD_KEY_F14_ATX:
        return Qt::Key_F14;
    case KD_KEY_F15_ATX:
        return Qt::Key_F15;
    case KD_KEY_F16_ATX:
        return Qt::Key_F16;
    case KD_KEY_F17_ATX:
        return Qt::Key_F17;
    case KD_KEY_F18_ATX:
        return Qt::Key_F18;
    case KD_KEY_F19_ATX:
        return Qt::Key_F19;
    case KD_KEY_F20_ATX:
        return Qt::Key_F20;
    case KD_KEY_F21_ATX:
        return Qt::Key_F21;
    case KD_KEY_F22_ATX:
        return Qt::Key_F22;
    case KD_KEY_F23_ATX:
        return Qt::Key_F23;
    case KD_KEY_F24_ATX:
        return Qt::Key_F24;
// KD_KEY_FINALMODE_ATX
// KD_KEY_FIND_ATX
// KD_KEY_FULLWIDTH_ATX
// KD_KEY_HALFWIDTH_ATX
    case KD_KEY_HANGULMODE_ATX:
        return Qt::Key_Hangul;
// KD_KEY_HANJAMODE_ATX
    case KD_KEY_HELP_ATX:
        return Qt::Key_Help;
    case KD_KEY_HIRAGANA_ATX:
        return Qt::Key_Hiragana;
    case KD_KEY_HOME_ATX:
        return Qt::Key_Home;
    case KD_KEY_INSERT_ATX:
        return Qt::Key_Insert;
// KD_KEY_JAPANESEHIRAGANA_ATX:
// KD_KEY_JAPANESEKATAKANA_ATX
// KD_KEY_JAPANESEROMAJI_ATX
// KD_KEY_JUNJAMODE_ATX
    case KD_KEY_KANAMODE_ATX:
        return Qt::Key_Kana_Lock; //?
    case KD_KEY_KANJIMODE_ATX:
        return Qt::Key_Kanji;
// KD_KEY_KATAKANA_ATX
// KD_KEY_LAUNCHAPPLICATION1_ATX
// KD_KEY_LAUNCHAPPLICATION2_ATX
    case KD_KEY_LAUNCHMAIL_ATX:
        return Qt::Key_MailForward;
    case KD_KEY_LEFT_ATX:
        return Qt::Key_Left;
    case KD_KEY_META_ATX:
        return Qt::Key_Meta;
    case KD_KEY_MEDIANEXTTRACK_ATX:
        return Qt::Key_MediaNext;
    case KD_KEY_MEDIAPLAYPAUSE_ATX:
        return Qt::Key_MediaPause;
    case KD_KEY_MEDIAPREVIOUSTRACK_ATX:
        return Qt::Key_MediaPrevious;
    case KD_KEY_MEDIASTOP_ATX:
        return Qt::Key_MediaStop;
    case KD_KEY_MODECHANGE_ATX:
        return Qt::Key_Mode_switch;
// KD_KEY_NONCONVERT_ATX
    case KD_KEY_NUMLOCK_ATX:
        return Qt::Key_NumLock;
    case KD_KEY_PAGEDOWN_ATX:
        return Qt::Key_PageDown;
    case KD_KEY_PAGEUP_ATX:
        return Qt::Key_PageUp;
    case KD_KEY_PASTE_ATX:
        return Qt::Key_Paste;
    case KD_KEY_PAUSE_ATX:
        return Qt::Key_Pause;
    case KD_KEY_PLAY_ATX:
        return Qt::Key_Play;
// KD_KEY_PREVIOUSCANDIDATE_ATX
    case KD_KEY_PRINTSCREEN_ATX:
        return Qt::Key_Print;
// case KD_KEY_PROCESS_ATX
// case KD_KEY_PROPS_ATX
    case KD_KEY_RIGHT_ATX:
        return Qt::Key_Right;
// KD_KEY_ROMANCHARACTERS_ATX
    case KD_KEY_SCROLL_ATX:
        return Qt::Key_ScrollLock;
    case KD_KEY_SELECT_ATX:
        return Qt::Key_Select;
// KD_KEY_SELECTMEDIA_ATX
    case KD_KEY_SHIFT_ATX:
        return Qt::Key_Shift;
    case KD_KEY_STOP_ATX:
        return Qt::Key_Stop;
    case KD_KEY_UP_ATX:
        return Qt::Key_Up;
// KD_KEY_UNDO_ATX
    case KD_KEY_VOLUMEDOWN_ATX:
        return Qt::Key_VolumeDown;
    case KD_KEY_VOLUMEMUTE_ATX:
        return Qt::Key_VolumeMute;
    case KD_KEY_VOLUMEUP_ATX:
        return Qt::Key_VolumeUp;
    case KD_KEY_WIN_ATX:
        return Qt::Key_Meta;
    case KD_KEY_ZOOM_ATX:
        return Qt::Key_Zoom;
    case 0x8:
        return Qt::Key_Backspace;
    case 0x1b:
        return Qt::Key_Escape;
    case 0x9:
        return Qt::Key_Tab;

    default:
        break;
    }

    return Qt::Key_Escape;
}

QT_END_NAMESPACE
#endif //KD_ATX_keyboard
#endif // OPENKODEKEYTRANSLATOR_H