# VICE keyboard mapping file
# C128 US symbolic map
#
# C64 map modified by Leif Bloomquist on March 23, 2007, to
#   give a proper symbolic mapping on US kbds. -- finally!!!
#
# Adapted to the C128 by Greg King on 2017-01-17.
#
# A Keyboard map is read in as a 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 -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

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

#0 -1 -1 0             /*           (no key)           */
1 7 7 8                /*          ESC -> RUN/STOP     */
2 7 0 8                /*            1 -> 1            */
3 7 3 32               /*            2 -> 2            */
3 5 6 16               /*            @ -> @            */
4 1 0 8                /*            3 -> 3            */
5 1 3 8                /*            4 -> 4            */
6 2 0 8                /*            5 -> 5            */
7 2 3 32               /*            6 -> 6            */
7 6 6 16               /*            ^ -> ^            */
8 3 0 32               /*            7 -> 7            */
8 2 3 1                /*            & -> &            */
9 3 3 32               /*            8 -> 8            */
9 6 1 16               /*            * -> *            */
10 4 0 32              /*            9 -> 9            */
10 3 3 1               /*            ( -> (            */
11 4 3 32              /*            0 -> 0            */
11 4 0 1               /*            ) -> )            */
12 5 3 32              /*        Minus -> Minus        */
12 7 1 0               /*   Underscore -> Left Arrow   */
13 6 5 32              /*        Equal -> Equal        */
13 5 0 16              /*            + -> +            */
14 0 0 8               /*    Backspace -> DEL          */
15 7 5 8               /*          TAB -> CBM          */
16 7 6 8               /*            Q -> Q            */
17 1 1 8               /*            W -> W            */
18 1 6 8               /*            E -> E            */
19 2 1 8               /*            R -> R            */
20 2 6 8               /*            T -> T            */
21 3 1 8               /*            Y -> Y            */
22 3 6 8               /*            U -> U            */
23 4 1 8               /*            I -> I            */
24 4 6 8               /*            O -> O            */
25 5 1 8               /*            P -> P            */
26 5 5 33              /*            [ -> [            */
26 5 0 1               /*            { -> Graphic +    */
27 6 2 33              /*            ] -> ]            */
27 5 6 1               /*            } -> Checkmark    */
28 0 1 8               /*       Return -> RETURN       */
29 7 2 8               /*    Left Ctrl -> CONTROL      */
30 1 2 8               /*            A -> A            */
31 1 5 8               /*            S -> S            */
32 2 2 8               /*            D -> D            */
33 2 5 8               /*            F -> F            */
34 3 2 8               /*            G -> G            */
35 3 5 8               /*            H -> H            */
36 4 2 8               /*            J -> J            */
37 4 5 8               /*            K -> K            */
38 5 2 8               /*            L -> L            */
39 6 2 32              /*            ; -> ;            */
39 5 5 16              /*            : -> :            */
40 3 0 33              /*            ' -> '            */
40 7 3 1               /*            " -> "            */
41 6 1 33              /*            ` -> Graphic Dash */
41 6 6 1               /*            ~ -> Pi           */
42 1 7 2               /*   Left Shift -> Left SHIFT   */
43 6 0 32              /*            \ -> Pound sign   */
43 5 3 1               /*            | -> |            */
44 1 4 8               /*            Z -> Z            */
45 2 7 8               /*            X -> X            */
46 2 4 8               /*            C -> C            */
47 3 7 8               /*            V -> V            */
48 3 4 8               /*            B -> B            */
49 4 7 8               /*            N -> N            */
50 4 4 8               /*            M -> M            */
51 5 7 8               /*            , -> ,            */
52 5 4 8               /*            . -> .            */
53 6 7 8               /*            / -> /            */
54 6 4 4               /*  Right Shift -> Right SHIFT  */
55 6 1 8               /*     Numpad * -> *            */
#56 -1 -1 0            /*     Left Alt -> (no key)     */
57 7 4 8               /*        Space -> Space        */

59 0 4 8               /*           F1 -> f2/f1        */
60 0 5 8               /*           F2 -> f4/f3        */
61 0 6 8               /*           F3 -> f6/f5        */
62 0 3 8               /*           F4 -> f8/f7        */
63 9 0 8               /*           F5 -> ESC          */
64 8 3 8               /*           F6 -> TAB          */
65 10 0 8              /*           F7 -> ALT          */
66 1 7 64              /*           F8 -> SHIFT LOCK   */
67 8 0 8               /*           F9 -> HELP         */
68 9 3 8               /*          F10 -> LINE-FEED    */
#69 -1 -1 0            /*     Num Lock -> (no key)     */
70 10 7 8              /*  Scroll Lock -> NO SCROLL    */
71 8 6 8               /*     Numpad 7 -> Numpad 7     */
72 8 1 8               /*     Numpad 8 -> Numpad 8     */
73 9 6 8               /*     Numpad 9 -> Numpad 9     */
74 9 2 8               /*     Numpad - -> Numpad -     */
75 8 5 8               /*     Numpad 4 -> Numpad 4     */
76 8 2 8               /*     Numpad 5 -> Numpad 5     */
77 9 5 8               /*     Numpad 6 -> Numpad 6     */
78 9 1 8               /*     Numpad + -> Numpad +     */
79 8 7 8               /*     Numpad 1 -> Numpad 1     */
80 8 4 8               /*     Numpad 2 -> Numpad 2     */
81 9 7 8               /*     Numpad 3 -> Numpad 3     */
82 10 1 8              /*     Numpad 0 -> Numpad 0     */
83 10 2 8              /*     Numpad . -> Numpad .     */
#84 -1 -1 0            /*       SysReq -> (no key)     */
#85 -1 -1 0            /*          #85 -> (no key)     */
#86 -1 -1 0            /*          #86 -> (no key)     */

88 10 7 8              /*          F12 -> NO SCROLL    */
89 6 3 8               /*         Home -> CLR/HOME     */
90 10 3 8              /*           Up -> Up           */

92 10 5 8              /*         Left -> Left         */
93 10 6 8              /*        Right -> Right        */
94 0 2 8               /*          End -> CRSR left/right */
95 10 4 8              /*         Down -> Down         */
96 0 7 8               /*       PgDown -> CRSR up/down */
97 0 0 1               /*       Insert -> INST (Shift-DEL) */
98 0 0 8               /*       Delete -> DEL          */
99 9 4 8               /* Numpad Enter -> Numpad ENTER */
#100 -1 -1 0           /*   Right Ctrl -> (no key)     */
#101 -1 -1 0           /*        Pause -> (no key)     */
#102 -1 -1 0           /*       PrtScr -> (no key)     */
103 6 7 8              /*     Numpad / -> /            */
#104 -1 -1 0           /*    Right Alt -> (no key)     */
#105 -1 -1 0           /*        Break -> (no key)     */
#106 -1 -1 0           /*   Left Win95 -> (no key)     */
#107 -1 -1 0           /*  Right Win95 -> (no key)     */
#108 -1 -1 0           /*         Menu -> (no key)     */

#
# Restore key mappings
#
91 -3 0                /*         PgUp -> RESTORE      */

#
# 40-/80-column key mapping
#
87 -4 0                /*          F11 -> 40/80 DISPLAY */

#
# CAPS (ASCII/DIN) key mapping
#
58 -4 1                /*    Caps Lock -> CAPS LOCK    */
