Each keymap uses a keycode table which stores functions to call on press and release for the keycode
Default keycode table encoded in the keycode scanner routine
Alternate keycode table may be specified by a keymap, if desired.
hooks mechanism already has a way to map a keycode to a function, so use the hooks mechanism to add dynamically map functions to key presses/releases when configuring keymaps.
Proposed architecture:
proposed api:
include "asdf.h"
include "asdf_hools.h"
hook functions would only need to be assigned for non-null actions. A NO-OP function is assigned by default during by hook_init().
the keyscan code would map the first user code ACTION_USER_START to hook ASDF_HOOK_USER_START, where:
==> for press: hook index = ASDF_HOOK_USER_START + (code - ACTION_USER_START) ==> for release: hook index = ASDF_HOOK_USER_START + (code - ACTION_USER_START) + 1