Key Mappings - cressie176/Load64 GitHub Wiki

1. Overview

                        ┌───────────────────────────────┐
                        │                               │
                        │      LaunchConfiguration      │
                        │                               │
                        └───────────────────────────────┘
                                        ┼
                                        ○
                                        │
                                        ○
                                       ╱│╲
┌──────────────────────────────────────────────────────────────────────────────┐
│                                                                              │
│                               KeyMapping                                     │
│                                                                              │
├──────────────────────────────────────────────────────────────────────────────┤
│ id: integer [pk]                                                             │
│ profile_id: integer [fk, required(1)]                                        │
│ launch_configuration_id: integer [fk, required(1)]                           │
│ host_key: host_keys [required, unique(Profile), unique(LaunchConfiguration)] │
│ system_key [required]                                                        │
└──────────────────────────────────────────────────────────────────────────────┘
                                       ╲│╱
                                        ○
                                        │
                                        ○
                                        ┼
                            ┌───────────────────────┐
                            │                       │
                            │        Profile        │
                            │                       │
                            └───────────────────────┘

A KeyMapping remaps a host keyboard key to a commodore system key when launching VICE. This allows physical keys to be rebound — for example mapping Escape to Run/Stop, or z/x to </> for left/right movement.

Key mappings can be defined on a Profile or directly on a Launch Configuration. Exactly one of profile_id or launch_configuration_id must be set (check constraint). A host_key must be unique within its owner.

2. Enums

system_keys

Used by both KeyMapping.system_key and GameControl.system_key. Values are drawn from the C64 keyboard matrix. See VICE SDL UK Keyboard Mapping File for the corresponding VICE row column values.

Special Keys

Value Label
space SPACE
return RETURN
run_stop RUN/STOP
restore RESTORE
ctrl CTRL
commodore C=
left_shift LEFT SHIFT
right_shift RIGHT SHIFT
shift_lock SHIFT LOCK
del DEL
clr_home CLR/HOME
crsr_up CRSR UP
crsr_down CRSR DOWN
crsr_left CRSR LEFT
crsr_right CRSR RIGHT

Function Keys

Value Label
f1 F1
f2 F2
f3 F3
f4 F4
f5 F5
f6 F6
f7 F7
f8 F8

Letter Keys

az — value and label are identical (e.g. value a, label A).

Number Keys

09 — value and label are identical (e.g. value 0, label 0).

Symbol Keys

Value Label
plus +
minus -
pound £
asterisk *
at @
left_arrow
up_arrow
colon :
semicolon ;
equals =
comma ,
period .
slash /

host_keys

Host keyboard keys used by KeyMapping.host_key. Values are the modern key names as listed in the VICE SDL UK Keyboard Mapping File.

Special Keys

Value Label
space Space
enter Enter
escape Esc
tab Tab
backspace Backspace
home Home
page_up Page Up
arrow_up Up Arrow
arrow_down Down Arrow
arrow_left Left Arrow
arrow_right Right Arrow
left_shift Left Shift
right_shift Right Shift
left_ctrl Left Ctrl
caps_lock Caps Lock

Function Keys

Value Label
f1 F1
f2 F2
f3 F3
f4 F4
f5 F5
f6 F6
f7 F7
f8 F8

Letter Keys

az — value and label are identical (e.g. value a, label A).

Number Keys

09 — value and label are identical (e.g. value 0, label 0).

Symbol Keys

Value Label
minus -
equals =
left_bracket [
right_bracket ]
backslash \
semicolon ;
apostrophe '
comma ,
period .
slash /
grave `

3. Tables

KeyMapping

Exactly one of profile_id or launch_configuration_id must be set (check constraint).

Field Type PK FK Nullable Unique Description
id integer yes Surrogate primary key.
profile_id integer Profile.id yes The profile this mapping belongs to. Null if owned by a launch configuration.
launch_configuration_id integer LaunchConfiguration.id yes The launch configuration this mapping belongs to. Null if owned by a profile.
host_key host_keys unique(Profile), unique(LaunchConfiguration) The host keyboard key to remap (e.g. "escape").
system_key system_keys The system key to map to (e.g. "run_stop").

4. Example

key_mapping

id profile_id launch_configuration_id host_key system_key
1 1 null escape run_stop
2 null 1 arrow_left crsr_left
3 null 1 arrow_right crsr_right
⚠️ **GitHub.com Fallback** ⚠️