mirror of
https://github.com/osiweb/unified_retro_keyboard.git
synced 2024-10-13 02:24:00 +00:00
7796b7f753
- update ARCHITECTURE-keymaps.org file for new keymap definition method - remove unused keymap table template files - in keymap_setup.c template, set default to keymap 0.
1.5 KiB
1.5 KiB
- Keymap architecture
- DIP SWITCHES
Keymap architecture
Keymap definition modules are in src/Keymaps
Each keymap has its own keymap setup routine
void setup_mapname_keymap(void) - keymap setup function
register a keycode map for each modifier combination
The keycode maps are in flash (ROM)
set up virtual devices for the keymap
virtual device to physical device mapping
associated virtual device function on activate/deactivate
initial state
set up function hooks used by keymap
Keymap definition API
mapping keys
#include "asdf_keymaps.h"
asdf_keymaps_add_map() - called from
Assigns a specified keymap matrix (ptr to FLASH) to a given keymap and modifier type.
adding virtual devices - called from keymap setup routine
asdf_virtual_init()
Clears the virtual device table for the keymap
initialize first entry in virtual device table to NULL
asdf_virtual_add_device()
Accept a virtual device code, a physical device code, a default function, and a default initial value, and create a new entry in the virtual device table.
increment the virtual device table pointer and set next (last) entry to NULL
DIP SWITCHES
Note that the DIP switches are keys in the key matrix, which is initialized to the all unpressed state at startup. Since the keymap is initialized to 0, the keymap is consistent with the presumed initial state of the DIP switches. If the DIP switches are not set to Keymap 0, then their position will be detected as keypresses, and the correct keymap will be set.