osiweb / unified_retro_keyboard

Project to provide keyboard replacements for various classic computers, as well as classic ASCII keyboard
94 stars 12 forks source link

Clean up key-code to function-call mappings. #26

Open dfnr2 opened 3 years ago

dfnr2 commented 3 years ago

Proposed architecture:

proposed api:

include "asdf.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