Skip to content

Commit a33406d

Browse files
committed
Map SDL_SCANCODE_NONUSBACKSLASH to Sanco's CARET key.
CARET key is unused in the current SLF800* map, so it can be useful to function as the additional key in modern ISO keyboards. For example, this key can be commonly found on contemporary French and Italian keyboards.
1 parent e13dc5e commit a33406d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/keyboard.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ static const ceda_associator_t associators[] = {
100100
{SDL_SCANCODE_EQUALS, CEDA_ASSOCIATOR_KEY, &(uint8_t){0x0E}},
101101
{SDL_SCANCODE_DELETE, CEDA_ASSOCIATOR_KEY, &(uint8_t){0x0F}},
102102
// {} ex CARET (0x10)
103+
// mapped to SDL_SCANCODE_NONUSBACKSLASH (additional key for ISO layout)
103104

104105
// row 2
105106
// {} BREAK (0x11)
@@ -159,6 +160,7 @@ static const ceda_associator_t associators[] = {
159160
// useful keys on modern IBM keyboards
160161
{SDL_SCANCODE_RCTRL, CEDA_ASSOCIATOR_FUNC, keyboard_toggle_modifier},
161162
{SDL_SCANCODE_LALT, CEDA_ASSOCIATOR_FUNC, keyboard_toggle_modifier},
163+
{SDL_SCANCODE_NONUSBACKSLASH, CEDA_ASSOCIATOR_KEY, &(uint8_t){0x10}},
162164

163165
// number pad
164166
{SDL_SCANCODE_UP, CEDA_ASSOCIATOR_KEY, &(uint8_t){0x3A}},
@@ -193,7 +195,7 @@ void keyboard_init(void) {
193195
}
194196

195197
void keyboard_handleEvent(const SDL_KeyboardEvent *event) {
196-
LOG_DEBUG("keycode = %" PRId32 ", repeat = %d\n", event->keysym.scancode,
198+
LOG_DEBUG("scancode = %" PRId32 ", repeat = %d\n", event->keysym.scancode,
197199
(int)event->repeat);
198200

199201
for (size_t i = 0; i < ARRAY_SIZE(associators); ++i) {

0 commit comments

Comments
 (0)