Xemu [doxygen]  hyppo 0a42be3a057156924bc1b626a687bd6e27349c45 @ Sat 19 Mar 02:15:11 CET 2022
tvc_keymatrix.c
Go to the documentation of this file.
1 /* Test-case for a very simple and inaccurate Videoton TV computer
2  (a Z80 based 8 bit computer) emulator.
3 
4  Part of the Xemu project, please visit: https://github.com/lgblgblgb/xemu
5  Copyright (C)2015-2017,2020-2021 LGB (Gábor Lénárt) <lgblgblgb@gmail.com>
6 
7  This emulator is HIGHLY inaccurate and unusable.
8 
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2 of the License, or
12 (at your option) any later version.
13 
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
18 
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
22 
23 #include "xemu/emutools.h"
24 #include "xemu/emutools_hid.h"
25 
26 const struct KeyMappingDefault tvc_key_map[] = {
27  // Row 0
28  { SDL_SCANCODE_5, 0x00 }, // 5
29  { SDL_SCANCODE_3, 0x01 }, // 3
30  { SDL_SCANCODE_2, 0x02 }, // 2
31  { SDL_SCANCODE_GRAVE, 0x03 }, // 0 we relocate 0, to match the "imagined" Hungarian keyboard layout ...
32  { SDL_SCANCODE_6, 0x04 }, // 6
33  { 100, 0x05 }, // í this is hard one, the scancode "100" is ISO keyboard, not ANSI and has different meaning on platforms ...
34  { SDL_SCANCODE_1, 0x06 }, // 1
35  { SDL_SCANCODE_4, 0x07 }, // 4
36  // Row 1
37  { -1, 0x10 }, // ^ TODO!
38  { SDL_SCANCODE_8, 0x11 }, // 8
39  { SDL_SCANCODE_9, 0x12 }, // 9
40  { SDL_SCANCODE_MINUS, 0x13 }, // ü Position on HUN kbd
41  { -1, 0x14 }, // * TODO!
42  { SDL_SCANCODE_EQUALS, 0x15 }, // ó Position on HUN kbd
43  { SDL_SCANCODE_0, 0x16 }, // ö Position on HUN kbd
44  { SDL_SCANCODE_7, 0x17 }, // 7
45  // Row 2
46  { SDL_SCANCODE_T, 0x20 }, // t
47  { SDL_SCANCODE_E, 0x21 }, // e
48  { SDL_SCANCODE_W, 0x22 }, // w
49  { -1, 0x23 }, // ; TODO!
50  { SDL_SCANCODE_Z, 0x24 }, // z
51  { -1, 0x25 }, // @ TODO!
52  { SDL_SCANCODE_Q, 0x26 }, // q
53  { SDL_SCANCODE_R, 0x27 }, // r
54  // Row 3
55  { -1, 0x30 }, // ] TODO! sadly, stupid HUN layout uses that at normal place :(
56  { SDL_SCANCODE_I, 0x31 }, // i
57  { SDL_SCANCODE_O, 0x32 }, // o
58  { SDL_SCANCODE_LEFTBRACKET, 0x33 }, // ő on HUN kbd
59  { -1, 0x34 }, // [ TODO! sadly, stupid HUN layout uses that at normal place :(
60  { SDL_SCANCODE_RIGHTBRACKET, 0x35 }, // ú on HUN kbd
61  { SDL_SCANCODE_P, 0x36 }, // p
62  { SDL_SCANCODE_U, 0x37 }, // u
63  // Row 4
64  { SDL_SCANCODE_G, 0x40 }, // g
65  { SDL_SCANCODE_D, 0x41 }, // d
66  { SDL_SCANCODE_S, 0x42 }, // s
67  { -1, 0x43 }, // blackslash TODO!
68  { SDL_SCANCODE_H, 0x44 }, // h
69  { -1, 0x45 }, // < TODO!
70  { SDL_SCANCODE_A, 0x46 }, // a
71  { SDL_SCANCODE_F, 0x47 }, // f
72  // Row 5
73  { SDL_SCANCODE_BACKSPACE, 0x50 }, // DEL
74  { SDL_SCANCODE_K, 0x51 }, // k
75  { SDL_SCANCODE_L, 0x52 }, // l
76  { SDL_SCANCODE_APOSTROPHE, 0x53 }, // á on HUN kbd
77  { SDL_SCANCODE_RETURN, 0x54 }, // RETURN
78  { SDL_SCANCODE_BACKSLASH, 0x55 }, // ű on HUN kbd
79  { SDL_SCANCODE_SEMICOLON, 0x56 }, // é on HUN kbd
80  { SDL_SCANCODE_J, 0x57 }, // j
81  // Row 6
82  { SDL_SCANCODE_B, 0x60 }, // b
83  { SDL_SCANCODE_C, 0x61 }, // c
84  { SDL_SCANCODE_X, 0x62 }, // x
85  { SDL_SCANCODE_LSHIFT, 0x63 }, // SHIFT
86  { SDL_SCANCODE_RSHIFT, 0x63 }, // SHIFT (right shift is also shift ...)
87  { SDL_SCANCODE_N, 0x64 }, // n
88  { SDL_SCANCODE_TAB, 0x65 }, // LOCK
89  { SDL_SCANCODE_Y, 0x66 }, // y
90  { SDL_SCANCODE_V, 0x67 }, // v
91  // Row 7
92  { SDL_SCANCODE_LALT, 0x70 }, // ALT
93  { SDL_SCANCODE_COMMA, 0x71 }, // ,?
94  { SDL_SCANCODE_PERIOD, 0x72 }, // .:
95  { SDL_SCANCODE_ESCAPE, 0x73 }, // ESC
96  { SDL_SCANCODE_LCTRL, 0x74 }, // CTRL
97  { SDL_SCANCODE_SPACE, 0x75 }, // SPACE
98  { SDL_SCANCODE_SLASH, 0x76 }, // -_
99  { SDL_SCANCODE_M, 0x77 }, // m
100  // Row 8, has "only" cursor control (joy), _and_ INS
101  { SDL_SCANCODE_INSERT, 0x80 }, // INS
102  { SDL_SCANCODE_UP, 0x81 }, // cursor up
103  { SDL_SCANCODE_DOWN, 0x82 }, // cursor down
104  { SDL_SCANCODE_RIGHT, 0x85 }, // cursor right
105  { SDL_SCANCODE_LEFT, 0x86 }, // cursor left
106  // Standard Xemu hot-keys, given by a macro
108  // **** this must be the last line: end of mapping table ****
109  { 0, -1 }
110 };
emutools.h
tvc_key_map
const struct KeyMappingDefault tvc_key_map[]
Definition: tvc_keymatrix.c:26
STD_XEMU_SPECIAL_KEYS
#define STD_XEMU_SPECIAL_KEYS
Definition: emutools_hid.h:108
KeyMappingDefault
Definition: emutools_hid.h:24
emutools_hid.h