# 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)
# '!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
#
# Negative row values:
# 'keysym -1 n' joystick #1, direction n
# 'keysym -2 n' joystick #2, 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
#

!CLEAR
!LSHIFT 1 3
!RSHIFT 6 4
!VSHIFT RSHIFT

53 0 3 8                /*          ESC -> Run/Stop     */
18 0 0 8                /*            1 -> 1            */
19 0 7 8                /*            2 -> 2            */
20 1 0 8                /*            3 -> 3            */
21 1 7 8                /*            4 -> 4            */
23 2 0 8                /*            5 -> 5            */
22 2 7 32               /*            6 -> 6            */
22 6 6 0                /*      Shift+6 -> Up Arrow     */
26 3 0 32               /*            7 -> 7            */
26 2 7 1                /*      Shift+7 -> &            */
28 3 7 32               /*            8 -> 8            */
28 6 1 0                /*      Shift+8 -> *            */
25 4 0 32               /*            9 -> 9            */
25 3 7 1                /*      Shift+9 -> (            */
29 4 7 32               /*            0 -> 0            */
29 4 0 1                /*      Shift+0 -> )            */
27 5 7 0                /*            - -> -            */
24 6 5 32               /*            = -> =            */
24 7 0 8                /*      Shift+= -> +            */

48 0 2 8               /*          TAB -> Ctrl         */
12 0 6 8               /*            Q -> Q            */
13 1 1 8               /*            W -> W            */
14 1 6 8               /*            E -> E            */
15 2 1 8               /*            R -> R            */
17 2 6 8               /*            T -> T            */
16 3 1 8               /*            Y -> Y            */
32 3 6 8               /*            U -> U            */
34 4 1 8               /*            I -> I            */
31 4 6 8               /*            O -> O            */
35 5 1 8               /*            p -> P            */
33 5 6 8               /*            [ -> @            */
30 6 1 8               /*            ] -> *            */
36 7 1 8               /*       Return -> Return       */
59 0 5 8               /*    Left Ctrl -> CBM          */

0 1 2 8                /*            A -> A            */
1 1 5 8                /*            S -> S            */
2 2 2 8                /*            D -> D            */
3 2 5 8                /*            F -> F            */
5 3 2 8                /*            G -> G            */
4 3 5 8                /*            H -> H            */
38 4 2 8               /*            J -> J            */
40 4 5 8               /*            K -> K            */
37 5 2 8               /*            L -> L            */
41 5 5 8               /*            ; -> :            */
39 6 2 8               /*            ' -> ;            */
10 0 1 8               /*           ^ -> Left Arrow   */
56 1 3 2               /*   Left Shift -> Left Shift   */

42 6 5 8               /*            \ -> =            */
6 1 4 8                /*            Z -> Z            */
7 2 3 8                /*            X -> X            */
8 2 4 8                /*            C -> C            */
9 3 3 8                /*            V -> V            */
11 3 4 8               /*            B -> B            */
45 4 3 8               /*            N -> N            */
46 4 4 8               /*            M -> M            */
43 5 3 8               /*            , -> ,            */
47 5 4 8               /*            . -> .            */
44 6 3 8               /*            / -> /            */

60 6 4 4               /*  Right Shift -> Right Shift  */
49 0 4 8               /*        Space -> Space        */
50 0 3 8               /*    Caps Lock -> Run/Stop     */

122 7 4 8               /*           F1 -> F1           */
120 7 4 1               /*           F2 -> F2           */
99  7 5 8               /*           F3 -> F3           */
118 7 5 1               /*           F4 -> F4           */
96  7 6 8               /*           F5 -> F5           */
97  7 6 1               /*           F6 -> F6           */
98  7 7 8               /*           F7 -> F7           */
100 7 7 1               /*           F8 -> F8           */

115 6 7 8               /*         Home -> CLR/HOME     */
126 7 3 1               /*           Up -> CRSR UP      */
123 7 2 1               /*         Left -> CRSR LEFT    */
124 7 2 8               /*        Right -> CRSR RIGHT   */
125 7 3 8               /*         Down -> CRSR DOWN    */
121 6 0 8               /*       PgDown -> Pound        */
116 6 6 8               /*       PgUp   -> Up Arrow     */

# Restore key mappings
111 -3 0                /*          F12 -> RESTORE      */

