Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

move keymap output mtk

 * remove the keymap.c
 * Remove unneeded key codes
 * add "include/ascii_keycodes.h".
 * for remove all tables (shift, altgr) out of mtk.git I have to direct get ASCII code
 * update the get_ascii: direct get ASCII from input.c
  • Loading branch information...
commit d26574251e12fcda9e36ea5e38c1022a56f95864 1 parent d00cd70
Xiangfu Liu authored
View
81 include/ascii_keycodes.h
@@ -0,0 +1,81 @@
+/*
+ * Copyright (C) 2011 Xiangfu Liu <xiangfu@sharism.cc>
+ *
+ * This file is part of the MTK package, which is distributed
+ * under the terms of the GNU General Public License version 2.
+ */
+
+#ifndef _MTK_ASCII_KEYCODES_H_
+#define _MTK_ASCII_KEYCODES_H_
+
+#define MTK_KEY_0 48
+#define MTK_KEY_1 49
+#define MTK_KEY_2 50
+#define MTK_KEY_3 51
+#define MTK_KEY_4 52
+#define MTK_KEY_5 53
+#define MTK_KEY_6 54
+#define MTK_KEY_7 55
+#define MTK_KEY_8 56
+#define MTK_KEY_9 57
+
+#define MTK_KEY_A 97 /* 'a' */
+#define MTK_KEY_B 98 /* 'b' */
+#define MTK_KEY_C 99 /* 'c' */
+#define MTK_KEY_D 100 /* 'd' */
+#define MTK_KEY_E 101 /* 'e' */
+#define MTK_KEY_F 102 /* 'f' */
+#define MTK_KEY_G 103 /* 'g' */
+#define MTK_KEY_H 104 /* 'h' */
+#define MTK_KEY_I 105 /* 'i' */
+#define MTK_KEY_J 106 /* 'j' */
+#define MTK_KEY_K 107 /* 'k' */
+#define MTK_KEY_L 108 /* 'l' */
+#define MTK_KEY_M 109 /* 'm' */
+#define MTK_KEY_N 110 /* 'n' */
+#define MTK_KEY_O 111 /* 'o' */
+#define MTK_KEY_P 112 /* 'p' */
+#define MTK_KEY_Q 113 /* 'q' */
+#define MTK_KEY_R 114 /* 'r' */
+#define MTK_KEY_S 115 /* 's' */
+#define MTK_KEY_T 116 /* 't' */
+#define MTK_KEY_U 117 /* 'u' */
+#define MTK_KEY_V 118 /* 'v' */
+#define MTK_KEY_W 119 /* 'w' */
+#define MTK_KEY_X 120 /* 'x' */
+#define MTK_KEY_Y 121 /* 'y' */
+#define MTK_KEY_Z 122 /* 'z' */
+
+#define MTK_KEY_ENTER 10
+#define MTK_KEY_SPACE 32
+
+#define MTK_KEY_DEG 167 /* '°' */
+#define MTK_KEY_PAR 21 /* '§' */
+#define MTK_KEY_ET 225 /* 'ß' */
+#define MTK_KEY_UE 129 /* 'ü' */
+#define MTK_KEY_OE 148 /* 'ö' */
+#define MTK_KEY_AE 132 /* 'ä' */
+#define MTK_KEY_UUE 154 /* 'Ü' */
+#define MTK_KEY_UOE 153 /* 'Ö' */
+#define MTK_KEY_UAE 142 /* 'Ä' */
+#define MTK_KEY_MU 230 /* 'µ' */
+#define MTK_KEY_DI 246 /* '÷' */
+#define MTK_KEY_S2 253 /* '²' */
+
+#define MTK_KEY_EA 130 /* 'é' */
+#define MTK_KEY_UEA 144 /* 'É' */
+#define MTK_KEY_DR 175 /* '»' */
+#define MTK_KEY_DL 174 /* '«' */
+#define MTK_KEY_PM 241 /* '±' */
+#define MTK_KEY_SU 15 /* '☼' */
+#define MTK_KEY_AG6 170 /* '¬' */
+#define MTK_KEY_CT 155 /* '¢' */
+#define MTK_KEY_PD 156 /* '£' */
+#define MTK_KEY_HF 171 /* '½' */
+#define MTK_KEY_QT 172 /* '¼' */
+#define MTK_KEY_PS 20 /* '¶' */
+
+
+#define MTK_KEY_ASCII_MAX 256
+
+#endif /* _MTK_ASCII_KEYCODES_H_ */
View
433 include/keycodes.h
@@ -9,387 +9,70 @@
* Copyright (C) 2004-2008 Norman Feske <norman.feske@genode-labs.com>
* Genode Labs, Feske & Helmuth Systementwicklung GbR
*
+ * Copyright (C) 2011 Xiangfu Liu <xiangfu@sharism.cc>
+ *
* This file is part of the MTK package, which is distributed
* under the terms of the GNU General Public License version 2.
*/
-/*
- * This file is part of the MTK package, which is distributed under
- * the terms of the GNU General Public Licence 2. Please see the
- * COPYING file for details.
- */
-
#ifndef _MTK_KEYCODES_H_
#define _MTK_KEYCODES_H_
-
-#define MTK_KEY_RESERVED 0
-#define MTK_KEY_ESC 1
-#define MTK_KEY_1 2
-#define MTK_KEY_2 3
-#define MTK_KEY_3 4
-#define MTK_KEY_4 5
-#define MTK_KEY_5 6
-#define MTK_KEY_6 7
-#define MTK_KEY_7 8
-#define MTK_KEY_8 9
-#define MTK_KEY_9 10
-#define MTK_KEY_0 11
-#define MTK_KEY_MINUS 12
-#define MTK_KEY_EQUAL 13
-#define MTK_KEY_BACKSPACE 14
-#define MTK_KEY_TAB 15
-#define MTK_KEY_Q 16
-#define MTK_KEY_W 17
-#define MTK_KEY_E 18
-#define MTK_KEY_R 19
-#define MTK_KEY_T 20
-#define MTK_KEY_Y 21
-#define MTK_KEY_U 22
-#define MTK_KEY_I 23
-#define MTK_KEY_O 24
-#define MTK_KEY_P 25
-#define MTK_KEY_LEFTBRACE 26
-#define MTK_KEY_RIGHTBRACE 27
-#define MTK_KEY_ENTER 28
-#define MTK_KEY_LEFTCTRL 29
-#define MTK_KEY_A 30
-#define MTK_KEY_S 31
-#define MTK_KEY_D 32
-#define MTK_KEY_F 33
-#define MTK_KEY_G 34
-#define MTK_KEY_H 35
-#define MTK_KEY_J 36
-#define MTK_KEY_K 37
-#define MTK_KEY_L 38
-#define MTK_KEY_SEMICOLON 39
-#define MTK_KEY_APOSTROPHE 40
-#define MTK_KEY_GRAVE 41
-#define MTK_KEY_LEFTSHIFT 42
-#define MTK_KEY_BACKSLASH 43
-#define MTK_KEY_Z 44
-#define MTK_KEY_X 45
-#define MTK_KEY_C 46
-#define MTK_KEY_V 47
-#define MTK_KEY_B 48
-#define MTK_KEY_N 49
-#define MTK_KEY_M 50
-#define MTK_KEY_COMMA 51
-#define MTK_KEY_DOT 52
-#define MTK_KEY_SLASH 53
-#define MTK_KEY_RIGHTSHIFT 54
-#define MTK_KEY_KPASTERISK 55
-#define MTK_KEY_LEFTALT 56
-#define MTK_KEY_SPACE 57
-#define MTK_KEY_CAPSLOCK 58
-#define MTK_KEY_F1 59
-#define MTK_KEY_F2 60
-#define MTK_KEY_F3 61
-#define MTK_KEY_F4 62
-#define MTK_KEY_F5 63
-#define MTK_KEY_F6 64
-#define MTK_KEY_F7 65
-#define MTK_KEY_F8 66
-#define MTK_KEY_F9 67
-#define MTK_KEY_F10 68
-#define MTK_KEY_NUMLOCK 69
-#define MTK_KEY_SCROLLLOCK 70
-#define MTK_KEY_KP7 71
-#define MTK_KEY_KP8 72
-#define MTK_KEY_KP9 73
-#define MTK_KEY_KPMINUS 74
-#define MTK_KEY_KP4 75
-#define MTK_KEY_KP5 76
-#define MTK_KEY_KP6 77
-#define MTK_KEY_KPPLUS 78
-#define MTK_KEY_KP1 79
-#define MTK_KEY_KP2 80
-#define MTK_KEY_KP3 81
-#define MTK_KEY_KP0 82
-#define MTK_KEY_KPDOT 83
-
-#define MTK_KEY_ZENKAKUHANKAKU 85
-#define MTK_KEY_102ND 86
-#define MTK_KEY_F11 87
-#define MTK_KEY_F12 88
-#define MTK_KEY_RO 89
-#define MTK_KEY_KATAKANA 90
-#define MTK_KEY_HIRAGANA 91
-#define MTK_KEY_HENKAN 92
-#define MTK_KEY_KATAKANAHIRAGANA 93
-#define MTK_KEY_MUHENKAN 94
-#define MTK_KEY_KPJPCOMMA 95
-#define MTK_KEY_KPENTER 96
-#define MTK_KEY_RIGHTCTRL 97
-#define MTK_KEY_KPSLASH 98
-#define MTK_KEY_SYSRQ 99
-#define MTK_KEY_RIGHTALT 100
-#define MTK_KEY_LINEFEED 101
-#define MTK_KEY_HOME 102
-#define MTK_KEY_UP 103
-#define MTK_KEY_PAGEUP 104
-#define MTK_KEY_LEFT 105
-#define MTK_KEY_RIGHT 106
-#define MTK_KEY_END 107
-#define MTK_KEY_DOWN 108
-#define MTK_KEY_PAGEDOWN 109
-#define MTK_KEY_INSERT 110
-#define MTK_KEY_DELETE 111
-#define MTK_KEY_MACRO 112
-#define MTK_KEY_MUTE 113
-#define MTK_KEY_VOLUMEDOWN 114
-#define MTK_KEY_VOLUMEUP 115
-#define MTK_KEY_POWER 116
-#define MTK_KEY_KPEQUAL 117
-#define MTK_KEY_KPPLUSMINUS 118
-#define MTK_KEY_PAUSE 119
-
-#define MTK_KEY_KPCOMMA 121
-#define MTK_KEY_HANGUEL 122
-#define MTK_KEY_HANJA 123
-#define MTK_KEY_YEN 124
-#define MTK_KEY_LEFTMETA 125
-#define MTK_KEY_RIGHTMETA 126
-#define MTK_KEY_COMPOSE 127
-
-#define MTK_KEY_STOP 128
-#define MTK_KEY_AGAIN 129
-#define MTK_KEY_PROPS 130
-#define MTK_KEY_UNDO 131
-#define MTK_KEY_FRONT 132
-#define MTK_KEY_COPY 133
-#define MTK_KEY_OPEN 134
-#define MTK_KEY_PASTE 135
-#define MTK_KEY_FIND 136
-#define MTK_KEY_CUT 137
-#define MTK_KEY_HELP 138
-#define MTK_KEY_MENU 139
-#define MTK_KEY_CALC 140
-#define MTK_KEY_SETUP 141
-#define MTK_KEY_SLEEP 142
-#define MTK_KEY_WAKEUP 143
-#define MTK_KEY_FILE 144
-#define MTK_KEY_SENDFILE 145
-#define MTK_KEY_DELETEFILE 146
-#define MTK_KEY_XFER 147
-#define MTK_KEY_PROG1 148
-#define MTK_KEY_PROG2 149
-#define MTK_KEY_WWW 150
-#define MTK_KEY_MSDOS 151
-#define MTK_KEY_COFFEE 152
-#define MTK_KEY_DIRECTION 153
-#define MTK_KEY_CYCLEWINDOWS 154
-#define MTK_KEY_MAIL 155
-#define MTK_KEY_BOOKMARKS 156
-#define MTK_KEY_COMPUTER 157
-#define MTK_KEY_BACK 158
-#define MTK_KEY_FORWARD 159
-#define MTK_KEY_CLOSECD 160
-#define MTK_KEY_EJECTCD 161
-#define MTK_KEY_EJECTCLOSECD 162
-#define MTK_KEY_NEXTSONG 163
-#define MTK_KEY_PLAYPAUSE 164
-#define MTK_KEY_PREVIOUSSONG 165
-#define MTK_KEY_STOPCD 166
-#define MTK_KEY_RECORD 167
-#define MTK_KEY_REWIND 168
-#define MTK_KEY_PHONE 169
-#define MTK_KEY_ISO 170
-#define MTK_KEY_CONFIG 171
-#define MTK_KEY_HOMEPAGE 172
-#define MTK_KEY_REFRESH 173
-#define MTK_KEY_EXIT 174
-#define MTK_KEY_MOVE 175
-#define MTK_KEY_EDIT 176
-#define MTK_KEY_SCROLLUP 177
-#define MTK_KEY_SCROLLDOWN 178
-#define MTK_KEY_KPLEFTPAREN 179
-#define MTK_KEY_KPRIGHTPAREN 180
-
-#define MTK_KEY_F13 183
-#define MTK_KEY_F14 184
-#define MTK_KEY_F15 185
-#define MTK_KEY_F16 186
-#define MTK_KEY_F17 187
-#define MTK_KEY_F18 188
-#define MTK_KEY_F19 189
-#define MTK_KEY_F20 190
-#define MTK_KEY_F21 191
-#define MTK_KEY_F22 192
-#define MTK_KEY_F23 193
-#define MTK_KEY_F24 194
-
-#define MTK_KEY_PLAYCD 200
-#define MTK_KEY_PAUSECD 201
-#define MTK_KEY_PROG3 202
-#define MTK_KEY_PROG4 203
-#define MTK_KEY_SUSPEND 205
-#define MTK_KEY_CLOSE 206
-#define MTK_KEY_PLAY 207
-#define MTK_KEY_FASTFORWARD 208
-#define MTK_KEY_BASSBOOST 209
-#define MTK_KEY_PRINT 210
-#define MTK_KEY_HP 211
-#define MTK_KEY_CAMERA 212
-#define MTK_KEY_SOUND 213
-#define MTK_KEY_QUESTION 214
-#define MTK_KEY_EMAIL 215
-#define MTK_KEY_CHAT 216
-#define MTK_KEY_SEARCH 217
-#define MTK_KEY_CONNECT 218
-#define MTK_KEY_FINANCE 219
-#define MTK_KEY_SPORT 220
-#define MTK_KEY_SHOP 221
-#define MTK_KEY_ALTERASE 222
-#define MTK_KEY_CANCEL 223
-#define MTK_KEY_BRIGHTNESSDOWN 224
-#define MTK_KEY_BRIGHTNESSUP 225
-#define MTK_KEY_MEDIA 226
-
-#define MTK_BTN_MISC 0x100
-#define MTK_BTN_0 0x100
-#define MTK_BTN_1 0x101
-#define MTK_BTN_2 0x102
-#define MTK_BTN_3 0x103
-#define MTK_BTN_4 0x104
-#define MTK_BTN_5 0x105
-#define MTK_BTN_6 0x106
-#define MTK_BTN_7 0x107
-#define MTK_BTN_8 0x108
-#define MTK_BTN_9 0x109
-
-#define MTK_BTN_MOUSE 0x110
-#define MTK_BTN_LEFT 0x110
-#define MTK_BTN_RIGHT 0x111
-#define MTK_BTN_MIDDLE 0x112
-#define MTK_BTN_SIDE 0x113
-#define MTK_BTN_EXTRA 0x114
-#define MTK_BTN_FORWARD 0x115
-#define MTK_BTN_BACK 0x116
-#define MTK_BTN_TASK 0x117
-
-#define MTK_BTN_JOYSTICK 0x120
-#define MTK_BTN_TRIGGER 0x120
-#define MTK_BTN_THUMB 0x121
-#define MTK_BTN_THUMB2 0x122
-#define MTK_BTN_TOP 0x123
-#define MTK_BTN_TOP2 0x124
-#define MTK_BTN_PINKIE 0x125
-#define MTK_BTN_BASE 0x126
-#define MTK_BTN_BASE2 0x127
-#define MTK_BTN_BASE3 0x128
-#define MTK_BTN_BASE4 0x129
-#define MTK_BTN_BASE5 0x12a
-#define MTK_BTN_BASE6 0x12b
-#define MTK_BTN_DEAD 0x12f
-
-#define MTK_BTN_GAMEPAD 0x130
-#define MTK_BTN_A 0x130
-#define MTK_BTN_B 0x131
-#define MTK_BTN_C 0x132
-#define MTK_BTN_X 0x133
-#define MTK_BTN_Y 0x134
-#define MTK_BTN_Z 0x135
-#define MTK_BTN_TL 0x136
-#define MTK_BTN_TR 0x137
-#define MTK_BTN_TL2 0x138
-#define MTK_BTN_TR2 0x139
-#define MTK_BTN_SELECT 0x13a
-#define MTK_BTN_START 0x13b
-#define MTK_BTN_MODE 0x13c
-#define MTK_BTN_THUMBL 0x13d
-#define MTK_BTN_THUMBR 0x13e
-
-#define MTK_BTN_DIGI 0x140
-#define MTK_BTN_TOOL_PEN 0x140
-#define MTK_BTN_TOOL_RUBBER 0x141
-#define MTK_BTN_TOOL_BRUSH 0x142
-#define MTK_BTN_TOOL_PENCIL 0x143
-#define MTK_BTN_TOOL_AIRBRUSH 0x144
-#define MTK_BTN_TOOL_FINGER 0x145
-#define MTK_BTN_TOOL_MOUSE 0x146
-#define MTK_BTN_TOOL_LENS 0x147
-#define MTK_BTN_TOUCH 0x14a
-#define MTK_BTN_STYLUS 0x14b
-#define MTK_BTN_STYLUS2 0x14c
-#define MTK_BTN_TOOL_DOUBLETAP 0x14d
-#define MTK_BTN_TOOL_TRIPLETAP 0x14e
-
-#define MTK_BTN_WHEEL 0x150
-#define MTK_BTN_GEAR_DOWN 0x150
-#define MTK_BTN_GEAR_UP 0x151
-
-#define MTK_KEY_OK 0x160
-#define MTK_KEY_SELECT 0x161
-#define MTK_KEY_GOTO 0x162
-#define MTK_KEY_CLEAR 0x163
-#define MTK_KEY_POWER2 0x164
-#define MTK_KEY_OPTION 0x165
-#define MTK_KEY_INFO 0x166
-#define MTK_KEY_TIME 0x167
-#define MTK_KEY_VENDOR 0x168
-#define MTK_KEY_ARCHIVE 0x169
-#define MTK_KEY_PROGRAM 0x16a
-#define MTK_KEY_CHANNEL 0x16b
-#define MTK_KEY_FAVORITES 0x16c
-#define MTK_KEY_EPG 0x16d
-#define MTK_KEY_PVR 0x16e
-#define MTK_KEY_MHP 0x16f
-#define MTK_KEY_LANGUAGE 0x170
-#define MTK_KEY_TITLE 0x171
-#define MTK_KEY_SUBTITLE 0x172
-#define MTK_KEY_ANGLE 0x173
-#define MTK_KEY_ZOOM 0x174
-#define MTK_KEY_MODE 0x175
-#define MTK_KEY_KEYBOARD 0x176
-#define MTK_KEY_SCREEN 0x177
-#define MTK_KEY_PC 0x178
-#define MTK_KEY_TV 0x179
-#define MTK_KEY_TV2 0x17a
-#define MTK_KEY_VCR 0x17b
-#define MTK_KEY_VCR2 0x17c
-#define MTK_KEY_SAT 0x17d
-#define MTK_KEY_SAT2 0x17e
-#define MTK_KEY_CD 0x17f
-#define MTK_KEY_TAPE 0x180
-#define MTK_KEY_RADIO 0x181
-#define MTK_KEY_TUNER 0x182
-#define MTK_KEY_PLAYER 0x183
-#define MTK_KEY_TEXT 0x184
-#define MTK_KEY_DVD 0x185
-#define MTK_KEY_AUX 0x186
-#define MTK_KEY_MP3 0x187
-#define MTK_KEY_AUDIO 0x188
-#define MTK_KEY_VIDEO 0x189
-#define MTK_KEY_DIRECTORY 0x18a
-#define MTK_KEY_LIST 0x18b
-#define MTK_KEY_MEMO 0x18c
-#define MTK_KEY_CALENDAR 0x18d
-#define MTK_KEY_RED 0x18e
-#define MTK_KEY_GREEN 0x18f
-#define MTK_KEY_YELLOW 0x190
-#define MTK_KEY_BLUE 0x191
-#define MTK_KEY_CHANNELUP 0x192
-#define MTK_KEY_CHANNELDOWN 0x193
-#define MTK_KEY_FIRST 0x194
-#define MTK_KEY_LAST 0x195
-#define MTK_KEY_AB 0x196
-#define MTK_KEY_NEXT 0x197
-#define MTK_KEY_RESTART 0x198
-#define MTK_KEY_SLOW 0x199
-#define MTK_KEY_SHUFFLE 0x19a
-#define MTK_KEY_BREAK 0x19b
-#define MTK_KEY_PREVIOUS 0x19c
-#define MTK_KEY_DIGITS 0x19d
-#define MTK_KEY_TEEN 0x19e
-#define MTK_KEY_TWEN 0x19f
-
-#define MTK_KEY_DEL_EOL 0x1c0
-#define MTK_KEY_DEL_EOS 0x1c1
-#define MTK_KEY_INS_LINE 0x1c2
-#define MTK_KEY_DEL_LINE 0x1c3
-
-#define MTK_KEY_MAX 0x1ff
-
+#include "ascii_keycodes.h"
+
+#define MTK_KEY_F1 (MTK_KEY_ASCII_MAX + 0)
+#define MTK_KEY_F2 (MTK_KEY_ASCII_MAX + 1)
+#define MTK_KEY_F3 (MTK_KEY_ASCII_MAX + 2)
+#define MTK_KEY_F4 (MTK_KEY_ASCII_MAX + 3)
+#define MTK_KEY_F5 (MTK_KEY_ASCII_MAX + 4)
+#define MTK_KEY_F6 (MTK_KEY_ASCII_MAX + 5)
+#define MTK_KEY_F7 (MTK_KEY_ASCII_MAX + 6)
+#define MTK_KEY_F8 (MTK_KEY_ASCII_MAX + 7)
+#define MTK_KEY_F9 (MTK_KEY_ASCII_MAX + 8)
+#define MTK_KEY_F10 (MTK_KEY_ASCII_MAX + 9)
+#define MTK_KEY_F11 (MTK_KEY_ASCII_MAX + 10)
+#define MTK_KEY_F12 (MTK_KEY_ASCII_MAX + 11)
+
+#define MTK_KEY_ESC (MTK_KEY_ASCII_MAX + 12)
+#define MTK_KEY_TAB (MTK_KEY_ASCII_MAX + 13)
+#define MTK_KEY_BACKSPACE (MTK_KEY_ASCII_MAX + 14)
+
+#define MTK_KEY_CAPSLOCK (MTK_KEY_ASCII_MAX + 15)
+#define MTK_KEY_NUMLOCK (MTK_KEY_ASCII_MAX + 16)
+
+#define MTK_KEY_SYSRQ (MTK_KEY_ASCII_MAX + 17)
+#define MTK_KEY_SCROLLLOCK (MTK_KEY_ASCII_MAX + 18)
+#define MTK_KEY_PAUSE (MTK_KEY_ASCII_MAX + 19)
+
+#define MTK_KEY_LEFTSHIFT (MTK_KEY_ASCII_MAX + 20)
+#define MTK_KEY_LEFTCTRL (MTK_KEY_ASCII_MAX + 21)
+#define MTK_KEY_LEFTALT (MTK_KEY_ASCII_MAX + 22)
+#define MTK_KEY_RIGHTSHIFT (MTK_KEY_ASCII_MAX + 23)
+#define MTK_KEY_RIGHTCTRL (MTK_KEY_ASCII_MAX + 24)
+#define MTK_KEY_RIGHTALT (MTK_KEY_ASCII_MAX + 25)
+#define MTK_KEY_LEFTMETA (MTK_KEY_ASCII_MAX + 26)
+#define MTK_KEY_RIGHTMETA (MTK_KEY_ASCII_MAX + 27)
+
+#define MTK_KEY_UP (MTK_KEY_ASCII_MAX + 28)
+#define MTK_KEY_LEFT (MTK_KEY_ASCII_MAX + 29)
+#define MTK_KEY_DOWN (MTK_KEY_ASCII_MAX + 30)
+#define MTK_KEY_RIGHT (MTK_KEY_ASCII_MAX + 31)
+
+#define MTK_KEY_PAGEUP (MTK_KEY_ASCII_MAX + 32)
+#define MTK_KEY_PAGEDOWN (MTK_KEY_ASCII_MAX + 33)
+#define MTK_KEY_HOME (MTK_KEY_ASCII_MAX + 34)
+#define MTK_KEY_END (MTK_KEY_ASCII_MAX + 35)
+#define MTK_KEY_INSERT (MTK_KEY_ASCII_MAX + 36)
+#define MTK_KEY_DELETE (MTK_KEY_ASCII_MAX + 37)
+
+#define MTK_BTN_LEFT (MTK_KEY_ASCII_MAX + 38)
+#define MTK_BTN_RIGHT (MTK_KEY_ASCII_MAX + 39)
+#define MTK_BTN_MIDDLE (MTK_KEY_ASCII_MAX + 40)
+
+#define MTK_BTN_GEAR_DOWN (MTK_KEY_ASCII_MAX + 41)
+#define MTK_BTN_GEAR_UP (MTK_KEY_ASCII_MAX + 42)
+
+#define MTK_KEY_MAX (MTK_KEY_ASCII_MAX + 43)
+#define MTK_KEY_INVALID MTK_KEY_MAX
#endif /* _MTK_KEYCODES_H_ */
View
7 include/mtklib.h
@@ -199,11 +199,4 @@ extern char mtk_get_ascii(int app_id, int keycode);
extern void mtk_config_set_wallpaper(unsigned short *wallpaper_bitmap, unsigned int wallpaper_w, unsigned int wallpaper_h);
-enum {
- MTK_KEYBOARD_LAYOUT_US = 0,
- MTK_KEYBOARD_LAYOUT_FRENCH,
- MTK_KEYBOARD_LAYOUT_GERMAN
-};
-extern void mtk_config_set_keyboard_layout(int layout);
-
#endif /* __MTK_INCLUDE_MTKLIB_H_ */
View
4 lib/button.c
@@ -227,7 +227,7 @@ static void but_handle_event(BUTTON *b, EVENT *e, WIDGET *from)
case EVENT_PRESS:
/* check for mouse button event */
- if ((e->code != MTK_BTN_MOUSE) && (e->code != MTK_KEY_SPACE)) break;
+ if ((e->code != MTK_BTN_LEFT) && (e->code != MTK_KEY_SPACE)) break;
if (b->bd->click) b->bd->click(b);
@@ -249,7 +249,7 @@ static void but_handle_event(BUTTON *b, EVENT *e, WIDGET *from)
case EVENT_RELEASE:
/* check for mouse button event */
- if (e->code == MTK_BTN_MOUSE) {
+ if (e->code == MTK_BTN_LEFT) {
if (b->bd->release) b->bd->release(b);
}
break;
View
2  lib/edit.c
@@ -450,7 +450,7 @@ static void edit_handle_event(EDIT *e, EVENT *ev, WIDGET *from)
case EVENT_PRESS:
case EVENT_KEY_REPEAT:
switch(ev->code) {
- case MTK_BTN_MOUSE:
+ case MTK_BTN_LEFT:
xpos -= e->ed->tx + 2 + 3 + e->ed->linenrw;
ypos -= e->ed->ty + 2 + 3;
e->ed->curpos = get_char_index(e, xpos, ypos);
View
2  lib/entry.c
@@ -415,7 +415,7 @@ static void entry_handle_event(ENTRY *e, EVENT *ev, WIDGET *from)
case EVENT_PRESS:
case EVENT_KEY_REPEAT:
switch(ev->code) {
- case MTK_BTN_MOUSE:
+ case MTK_BTN_LEFT:
xpos -= e->ed->tx + 2 + 3;
e->ed->curpos = get_char_index(e, xpos);
e->ed->sel_beg = e->ed->sel_end = e->ed->curpos;
View
139 lib/keymap.c
@@ -1,139 +0,0 @@
-/*
- * \brief MTK keymap module
- *
- * Functions to map keycodes to its corresponding
- * ASCII values while taking modifier keys (e.g.
- * shift) into account.
- */
-
-/*
- * Copyright (C) 2002-2008 Norman Feske <norman.feske@genode-labs.com>
- * Genode Labs, Feske & Helmuth Systementwicklung GbR
- *
- * This file is part of the MTK package, which is distributed
- * under the terms of the GNU General Public License version 2.
- */
-
-#include "mtkstd.h"
-#include "keymap.h"
-
-#define BS 8
-#define ESC 27
-#define TAB 11
-#define LF 10
-
-#define DEG 167 /* '°' */
-#define PAR 21 /* '§' */
-#define ET 225 /* 'ß' */
-#define UE 129 /* 'ü' */
-#define OE 148 /* 'ö' */
-#define AE 132 /* 'ä' */
-#define MU 230 /* 'µ' */
-#define DI 246 /* '÷' */
-#define EA 130 /* 'é' */
-#define DR 175 /* '»' */
-
-static int curr_layout = 2;
-
-/*
- * TODO: AltGr not working, it's same as SHIFT,
- * Non-ascii not working.
- * SHIFLT of 'ö' 'ä' 'µ' 'é' '»' not working.
- * http://ascii-table.com/keyboards.php
- */
-static char keymap[3][128] = {
- { 0,ESC,'1','2','3','4','5','6','7','8','9','0','-','=', BS,TAB, /* 16 */
- 'q','w','e','r','t','y','u','i','o','p','[',']', LF, 0,'a','s', /* 32 */
- 'd','f','g','h','j','k','l',';','\'','`',0,'\\','z','x','c','v', /* 48 */
- 'b','n','m',',','.','/', 0,'*', 0,' ', 0, 0, 0, 0, 0, 0, /* 64 */
- 0, 0, 0, 0, 0, 0, 0,'7','8','9','-','4','5','6','+','1', /* 80 */
- '2','3','0','.', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 96 */
- LF, 0,'/', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 112 */
- }, /* US layout 103P */
- { 0,ESC,'1','2','3','4','5','6','7','8','9','0','-','=', BS,TAB,
- 'q','w','e','r','t','y','u','i','o','p','[',']', LF, 0,'a','s',
- 'd','f','g','h','j','k','l',';','{','#',0,'<','z','x','c','v',
- 'b','n','m',',','.', EA, 0,'*', 0,' ', 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0,'7','8','9','-','4','5','6','+','1',
- '2','3','0','.', 0, 0, DR, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- LF, 0,'/', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- }, /* French layout 058 */
- { 0,ESC,'1','2','3','4','5','6','7','8','9','0','\\', 0,BS,TAB,
- 'q','w','e','r','t','z','u','i','o','p', UE,'+', LF, 0,'a','s',
- 'd','f','g','h','j','k','l',OE, AE,'^', 0,'#','y','x','c','v',
- 'b','n','m',',','.','-', 0,'*', 0,' ', 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0,'7','8','9','-','4','5','6','+','1',
- '2','3','0',',', 0, 0,'<', 0, 0, 0, 0, 0, 0, 0, 0, 0,
- LF, 0, DI, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- } /* German layout 129 */
-};
-
-static char shift[3][128] = {
- {' ', 0 , 0 , 0 , 0 , 0 , 0,'\"', 0, 0 , 0 , 0 ,'<','_','>','?', /* 16 */
- ')','!','@','#','$','%','^','&','*','(', 0 ,':', 0 ,'+', 0 , 0 , /* 32 */
- 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , /* 48 */
- 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,'{','|','}', 0 , 0 , /* 64 */
- '~',
- }, /* US layout 103P */
- {' ', 0 , 0 ,'|', 0 , 0 , 0, 0 , 0, 0 , 0 , 0,'\'','_','\"', 0 ,
- ')','!','\"','/','$','%','?','&','*','(',0 ,':','>','+', 0 , 0 ,
- 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
- 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,'{', 0 ,'}', 0 , 0 ,
- }, /* French layout 058 */
- {' ', 0 , 0 ,39, 0 , 0 , 0 , 0 , 0 , 0 , 0 ,'*',';','_',':', 0 ,
- '=','!','"',PAR,'$','%','&','/','(',')', 0 , 0 ,'>', 0 , 0 , 0 ,
- 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
- 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,'?', 0 ,DEG, 0 ,
- } /* German layout 129 */
-};
-
-int init_keymap(struct mtk_services *d);
-
-/***********************
- ** Service functions **
- ***********************/
-
-
-static char get_ascii(int keycode,int switches)
-{
- char result;
- if (keycode>=112) return 0;
- result = keymap[curr_layout][keycode];
- if (!result) return 0;
- if (switches & (KEYMAP_SWITCH_LSHIFT|KEYMAP_SWITCH_RSHIFT)) {
- if ((result >= 'a') && (result <= 'z')) {
- result -= 32;
- return result;
- }
- result-=32;
- if (result<=64) return shift[curr_layout][(s32)result];
- }
- return result;
-}
-
-/**************************************
- ** Service structure of this module **
- **************************************/
-
-static struct keymap_services services = {
- get_ascii,
-};
-
-
-/************************
- ** Module entry point **
- ************************/
-
-int init_keymap(struct mtk_services *d)
-{
- d->register_module("Keymap 1.0",&services);
- return 1;
-}
-
-void mtk_config_set_keyboard_layout(int layout)
-{
- if (curr_layout < 0 || curr_layout > 2)
- return;
-
- curr_layout = layout;
-}
View
2  lib/libmtk-generic.mk
@@ -20,7 +20,7 @@ SRC_C += \
fontman.c frame.c gfx.c \
gfx_img16.c gfx_img32.c \
widman.c conv_tff.c grid.c \
- hashtab.c keymap.c label.c \
+ hashtab.c label.c \
loaddisplay.c pool.c \
winlayout.c redraw.c scale.c \
window.c screen.c script.c \
View
2  lib/list.c
@@ -150,7 +150,7 @@ static void lst_handle_event(LIST *l, EVENT *ev, WIDGET *from)
case EVENT_PRESS:
case EVENT_KEY_REPEAT:
switch (ev->code) {
- case MTK_BTN_MOUSE:
+ case MTK_BTN_LEFT:
ypos -= 2 + 2;
s = ypos/l->ld->ch;
if(s < 0) s = 0;
View
4 lib/main.c
@@ -35,7 +35,6 @@ extern void *pool_get(char *name);
/**
* Prototypes from 'modules'
*/
-extern int init_keymap (struct mtk_services *);
extern int init_clipping (struct mtk_services *);
extern int init_scrdrv (struct mtk_services *);
extern int init_widman (struct mtk_services *);
@@ -115,9 +114,6 @@ int mtk_init(void *fb, int width, int height)
INFO(printf("%sTick\n",dbg));
init_tick(&mtk);
- INFO(printf("%sKeymap\n",dbg));
- init_keymap(&mtk);
-
INFO(printf("%sCache\n",dbg));
init_cache(&mtk);
View
14 lib/userstate.c
@@ -27,14 +27,12 @@
#include "tick.h"
#include "messenger.h"
#include "widget_data.h"
-#include "keymap.h"
#include "keycodes.h"
#include "window.h"
static struct scrdrv_services *scrdrv;
static struct redraw_services *redraw;
static struct tick_services *tick;
-static struct keymap_services *keymap;
static s32 omx,omy,omb; /* original mouse postion */
static s32 curr_mx, curr_my; /* current mouse position */
@@ -91,15 +89,8 @@ static inline int key_sets_focus(int keycode)
*/
static char get_ascii(int keycode)
{
- int switches=0;
- if (keycode>=MTK_KEY_MAX) return 0;
- if (keytab[42] ) switches = switches | KEYMAP_SWITCH_LSHIFT;
- if (keytab[54] ) switches = switches | KEYMAP_SWITCH_RSHIFT;
- if (keytab[29] ) switches = switches | KEYMAP_SWITCH_LCONTROL;
- if (keytab[97] ) switches = switches | KEYMAP_SWITCH_RCONTROL;
- if (keytab[56] ) switches = switches | KEYMAP_SWITCH_ALT;
- if (keytab[100]) switches = switches | KEYMAP_SWITCH_ALTGR;
- return keymap->get_ascii(keycode,switches);
+ if (keycode>=MTK_KEY_ASCII_MAX) return 0;
+ return keycode;
}
@@ -671,7 +662,6 @@ int init_userstate(struct mtk_services *d)
scrdrv = d->get_module("ScreenDriver 1.0");
redraw = d->get_module("RedrawManager 1.0");
tick = d->get_module("Tick 1.0");
- keymap = d->get_module("Keymap 1.0");
d->register_module("UserState 1.0",&services);
return 1;
Please sign in to comment.
Something went wrong with that request. Please try again.