Closed Wuerfel21 closed 1 year ago
Also, here are scancode constants, with the awful abbreviations removed:
' Keyboard keys
'-------------
' The first four scancodes are info/error indicators:
#$00, KEY_NO_KEY, KEY_ERR_ROLLOVER, KEY_POST_FAIL, KEY_ERR_UNDEF
' Letters:
KEY_A = $04
KEY_B = $05
KEY_C = $06
KEY_D = $07
KEY_E = $08
KEY_F = $09
KEY_G = $0a
KEY_H = $0b
KEY_I = $0c
KEY_J = $0d
KEY_K = $0e
KEY_L = $0f
KEY_M = $10
KEY_N = $11
KEY_O = $12
KEY_P = $13
KEY_Q = $14
KEY_R = $15
KEY_S = $16
KEY_T = $17
KEY_U = $18
KEY_V = $19
KEY_W = $1a
KEY_X = $1b
KEY_Y = $1c
KEY_Z = $1d
' Number Row:
KEY_1 = $1e
KEY_2 = $1f
KEY_3 = $20
KEY_4 = $21
KEY_5 = $22
KEY_6 = $23
KEY_7 = $24
KEY_8 = $25
KEY_9 = $26
KEY_0 = $27
' Keyboard return (ENTER), tab, space, etc.:
KEY_ENTER = $28
KEY_ESC = $29
KEY_BACKSPACE = $2a ' Delete (backspace)
KEY_TAB = $2b
KEY_SPACE = $2c
KEY_MINUS = $2d ' - and _
KEY_EQUAL = $2e ' = and +
KEY_LBRACE = $2f ' [ and {
KEY_RBRACE = $30 ' ] and }
KEY_BACKSLASH = $31 ' \ and |
KEY_HASHTILDE = $32 ' None-US # and ~
KEY_SEMICOLON = $33 ' ; and :
KEY_APOST = $34 ' ' and "
KEY_GRAVE = $35 ' ` and ~
KEY_COMMA = $36 ' , and <
KEY_DOT = $37 ' . and >
KEY_SLASH = $38 ' / and ?
KEY_CAPSLOCK = $39
' Function key scancodes:
KEY_F1 = $3a
KEY_F2 = $3b
KEY_F3 = $3c
KEY_F4 = $3d
KEY_F5 = $3e
KEY_F6 = $3f
KEY_F7 = $40
KEY_F8 = $41
KEY_F9 = $42
KEY_F10 = $43
KEY_F11 = $44
KEY_F12 = $45
' Special, toggle and movement keys:
KEY_PRINTSCREEN = $46
KEY_SCROLLLOCK = $47
KEY_PAUSE = $48
KEY_INSERT = $49
KEY_HOME = $4a
KEY_PAGEUP = $4b
KEY_DELETE = $4c
KEY_END = $4d
KEY_PAGEDOWN = $4e
KEY_RIGHT = $4f
KEY_LEFT = $50
KEY_DOWN = $51
KEY_UP = $52
' Keypad keys:
KEY_NUMLOCK = $53
KEY_NUMSLASH = $54
KEY_NUMASTER = $55
KEY_NUMMINUS = $56
KEY_NUMPLUS = $57
KEY_NUMENTER = $58
KEY_NUM1 = $59
KEY_NUM2 = $5a
KEY_NUM3 = $5b
KEY_NUM4 = $5c
KEY_NUM5 = $5d
KEY_NUM6 = $5e
KEY_NUM7 = $5f
KEY_NUM8 = $60
KEY_NUM9 = $61
KEY_NUM0 = $62
KEY_DOT_DEL = $63
KEY_NOUS_SP = $64 ' Non-US \ and |
KEY_APP = $65 ' Application key
' Modifier keys:
KEY_LCTRL = $E0
KEY_LSHIFT = $E1
KEY_LALT = $E2
KEY_LMETA = $E3 ' The left "Windows" key
KEY_RCTRL = $E4
KEY_RSHIFT = $E5
KEY_RALT = $E6
KEY_RMETA = $E7 ' The right "Windows" key
Seems that today's changes caused a merge conflict (don't understand why but anyway...). I'll do the changes myself so I can clean hkbd_translate a bit.
Added as part of commit 4a74347d5b43c38eb347ee58decfd086e2ca0ad1
They are infact defined to have scancodes E0 through E7, so better generate those. The ascii table is not long enough to deal with them, so maybe fix that.