# VICE keyboard mapping file
#
# A Keyboard map is read in as patch to the current map.
#
# File format:
# - comment lines start with '#'
# - keyword lines start with '!keyword'
# - normal line has 'keysym/scancode row column shiftflag'
#
# Keywords and their lines are:
# '!CLEAR'               clear whole table
# '!INCLUDE filename'    read file as mapping file
# '!LSHIFT row col'      left shift keyboard row/column
# '!RSHIFT row col'      right shift keyboard row/column
# '!VSHIFT shiftkey'     virtual shift key (RSHIFT or LSHIFT)
# '!SHIFTL shiftkey'     shift lock key (RSHIFT or LSHIFT)
# '!UNDEF keysym'        remove keysym from table
#
# Shiftflag can have the values:
# 0      key is not shifted for this keysym/scancode
# 1      key is shifted for this keysym/scancode
# 2      left shift
# 4      right shift
# 8      key can be shifted or not with this keysym/scancode
# 16     deshift key for this keysym/scancode
# 32     another definition for this keysym/scancode follows
# 64     shift lock
# 256    key is used for an alternative keyboard mapping
#
# Negative row values:
# 'keysym -1 n' joystick keymap A, direction n
# 'keysym -2 n' joystick keymap B, direction n
# 'keysym -3 0' first RESTORE key
# 'keysym -3 1' second RESTORE key
# 'keysym -4 0' 40/80 column key
# 'keysym -4 1' CAPS (ASCII/DIN) key
# 'keysym -5 n' joyport keypad, key n
#
# Joystick direction values:
# 0      Fire
# 1      South/West
# 2      South
# 3      South/East
# 4      West
# 5      East
# 6      North/West
# 7      North
# 8      North/East
#
# Joyport keypad key layout:
# --------------------------
# |  0 |  1 |  2 |  3 |  4 |
# --------------------------
# |  5 |  6 |  7 |  8 |  9 |
# --------------------------
# | 10 | 11 | 12 | 13 | 14 |
# --------------------------
# | 15 | 16 | 17 | 18 | 19 |
# --------------------------
#
# When a bigger spaced key is used,
# it uses the upper left most key value.

!CLEAR
!LSHIFT 1 7
!RSHIFT 6 4
!VSHIFT RSHIFT
!SHIFTL LSHIFT

# this keymap works (at last for me) for pc(105)-de keyboard
100 2 2 8              /*            D -> D            */
101 1 6 8              /*            E -> E            */
102 2 5 8              /*            F -> F            */
103 3 2 8              /*            G -> G            */
104 3 5 8              /*            H -> H            */
105 4 1 8              /*            I -> I            */
106 4 2 8              /*            J -> J            */
107 4 5 8              /*            K -> K            */
108 5 2 8              /*            L -> L            */
109 4 4 8              /*            M -> M            */
110 4 7 8              /*            N -> N            */
111 4 6 8              /*            O -> O            */
112 5 1 8              /*            P -> P            */
113 7 6 8              /*            Q -> Q            */
114 2 1 8              /*            R -> R            */
115 1 5 8              /*            S -> S            */
116 2 6 8              /*            T -> T            */
117 3 6 8              /*            U -> U            */
118 3 7 8              /*            V -> V            */
119 1 1 8              /*            W -> W            */
120 2 7 8              /*            X -> X            */
121 3 1 8              /*            Y -> Y            */
122 1 4 8              /*            Z -> Z            */
127 0 0 8              /*          Ins -> Ins          */
13 0 1 8               /*       Return -> Return       */
223 6 0 32             /* (de)      sz -> Pound        */
223 6 7 1              /*            ? -> ?            */
228 6 2 1              /* (de)      ae -> ]            */
246 5 5 1              /* (de)      oe -> [            */
252 5 6 0              /* (de)      ue -> @            */
267 6 7 8              /*     NumPad / -> /            */
268 6 1 8              /*     NumPad * -> *            */
269 5 3 8              /*     NumPad - -> -            */
27 7 7 8               /*          ESC -> Run/Stop     */
270 5 0 8              /*     NumPad + -> +            */
273 0 7 1              /*           Up -> CRSR UP      */
274 0 7 8              /*         Down -> CRSR DOWN    */
275 0 2 8              /*        Right -> CRSR RIGHT   */
276 0 2 1              /*         Left -> CRSR LEFT    */
277 0 0 1              /*          Del -> Del          */
278 6 3 8              /*         Home -> CLR/HOME     */
282 0 4 8              /*           F1 -> F1           */
283 0 4 1              /*           F2 -> F2           */
284 0 5 8              /*           F3 -> F3           */
285 0 5 1              /*           F4 -> F4           */
286 0 6 8              /*           F5 -> F5           */
287 0 6 1              /*           F6 -> F6           */
288 0 3 8              /*           F7 -> F7           */
289 0 3 1              /*           F8 -> F8           */
303 6 4 4              /*  Right Shift -> Right Shift  */
304 1 7 2              /*   Left Shift -> Left Shift   */
301 1 7 64             /*    Caps Lock -> Shift Lock   */
306 7 5 8              /*    Left Ctrl -> CBM          */
314 3 0 1              /*           ´  -> '            */
32 7 4 8               /*        Space -> Space        */
35 1 0 33              /*            # -> #            */
35 3 0 1               /*            ' -> '            */
43 5 0 32              /*            + -> +            */
43 6 1 0               /*            * -> *            */
44 5 7 32              /*            , -> ,            */
44 6 2 0               /*            ; -> ;            */
45 5 3 8               /*            - -> -            */
46 5 4 32              /*            . -> .            */
46 5 5 0               /*            : -> :            */
48 4 3 32              /*            0 -> 0            */
48 6 5 16              /*            = -> =            */
49 7 0 8               /*            1 -> 1            */
50 7 3 8               /*            2 -> 2            */
51 1 0 8               /*            3 -> 3            */
52 1 3 8               /*            4 -> 4            */
53 2 0 8               /*            5 -> 5            */
54 2 3 8               /*            6 -> 6            */
55 3 0 32              /*            7 -> 7            */
55 6 7 0               /*            / -> /            */
56 3 3 8               /*            8 -> 8            */
57 4 0 8               /*            9 -> 9            */
60 5 7 33              /*            < -> <            */
60 5 4 1               /*            > -> >            */
8 7 1 0                /*    Backspace -> Left Arrow   */
9 7 2 8                /*          TAB -> Ctrl         */
94 6 6 32              /*            ^ -> Up Arrow     */
94 6 6 1               /*            ° -> Pi           */
97 1 2 8               /*            A -> A            */
98 3 4 8               /*            B -> B            */
99 2 4 8               /*            C -> C            */

# Restore key mappings
280 -3 0
0 -3 1

# Joyport attached keypad key mappings
300 -5 0              /*      NumLock -> keypad x0    */
263 -5 1              /*     NumPad 7 -> keypad 7     */
264 -5 2              /*     NumPad 8 -> keypad 8     */
265 -5 3              /*     NumPad 9 -> keypad 9     */
267 -5 4              /*     NumPad / -> keypad /     */
302 -5 5              /*   ScrollLock -> keypad x1    */
260 -5 6              /*     NumPad 4 -> keypad 4     */
261 -5 7              /*     NumPad 5 -> keypad 5     */
262 -5 8              /*     NumPad 6 -> keypad 6     */
268 -5 9              /*     NumPad * -> keypad *     */
317 -5 10             /*       SysReq -> keypad x2    */
257 -5 11             /*     NumPad 1 -> keypad 1     */
258 -5 12             /*     NumPad 2 -> keypad 2     */
259 -5 13             /*     NumPad 3 -> keypad 3     */
269 -5 14             /*     NumPad - -> keypad -     */
316 -5 15             /*       PrtScr -> keypad x3    */
256 -5 16             /*     NumPad 0 -> keypad 0     */
266 -5 17             /*     NumPad , -> keypad .     */
271 -5 18             /* NumPad Enter -> keypad enter */
270 -5 19             /*     NumPad + -> keypad +     */
