From: Christian G. <ko...@ya...> - 2015-04-12 22:10:21
|
Hi, when I connected a German keybaord it gave me just scancodes in the high byte. Looking at kernel/arch/dreamcast/hardware/maple/keyboard.c I see that only Japanese and US keyboards are supported. All other keyboards just return scancodes. I propose the following change for unsupported keyboards to let them at least appear as an US keyboard. I think that's better than returning scancodes for keys which were previously (in older KOS versions) returned as ASCII. -------------------- --- a/kernel/arch/dreamcast/hardware/maple/keyboard.c +++ b/kernel/arch/dreamcast/hardware/maple/keyboard.c @@ -354,6 +354,10 @@ static int kbd_attach(maple_driver_t *drv, maple_device_t *dev) { else state->region = dev->info.function_data[d] & 0xFF; + if (state->region > KBD_NUM_KEYMAPS) + /* Punt #2. */ + state->region = KBD_REGION_US; + /* Make sure all the queue variables are set up properly... */ state->queue_tail = state->queue_head = state->queue_len = 0; -------------------- And, I want to support German keyboards. They identify as region #4. The 'keymaps' array in kernel/arch/dreamcast/hardware/maple/keyboard.c just has entries for (regions) #1 and #2. I don't know what region #3 is. I'd add it as just zeroes, and add a check in above patch to map it to an US keyboard, What do you think? regards, chris |