Closed mihaip closed 7 months ago
Please convert all those kVK_ANSI_x
comments into an enum and use the corresponding constants instead of magic numbers.
I find the kVK_ANSI
prefix misleading and propose to use kVK_x
instead:
enum {
kVK_A = 0x00,
// ...
};
switch (event.keysym.sym) {
case SDLK_a: return kVK_A;
}
if (ke.key == kVK_CapsLock) {
ke.flags = SDL_GetModState() & KMOD_CAPS ?
KEYBOARD_EVENT_DOWN : KEYBOARD_EVENT_UP;
}
The definitions for the virtual keys should go into adbkeyboard.h
.
Please convert all those
kVK_ANSI_x
comments into an enum and use the corresponding constants instead of magic numbers. I find thekVK_ANSI
prefix misleading and propose to usekVK_x
instead.
Makes sense. I went with an AbbKey
prefix for the enums, since kVK_
didn't seem quite right either -- they're raw ADB key codes, not virtual ones.
Besides generating
KeyboardEvent
s in the SDL event handler and returning the key state in the register 0 reads of theAdbKeyboard
device, we also needed to generalize the ADB bus polling a bit. We now check all devices that have the service request bit set, instead of hardcoding the mouse.The SDL key event -> ADB raw key code mapping is based on BasiliskII/ SheepShaver's, but cleaned up a bit.
To test this, I've been using the PDM ROM with a slightly tweaked 7.1.2 Disk Tools image that has the Key Caps DA installed.