1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-11-26 23:52:26 +00:00

Improved key map. Possibly enough to type some basic BASIC?

This commit is contained in:
Thomas Harte 2016-06-11 13:19:59 -04:00
parent d1731b1d26
commit 3e8d383615
2 changed files with 48 additions and 3 deletions

View File

@ -41,7 +41,7 @@ enum Key: uint16_t {
KeyLeft = key(1, 0x01), KeyW = key(1, 0x02), KeyR = key(1, 0x04), KeyY = key(1, 0x08),
KeyI = key(1, 0x10), KeyP = key(1, 0x20), KeyAsterisk = key(1, 0x40), KeyReturn = key(1, 0x80),
Key1 = key(0, 0x01), Key3 = key(0, 0x02), Key5 = key(0, 0x04), Key7 = key(0, 0x08),
Key9 = key(0, 0x10), KeyPlus = key(0, 0x20), KeyGBP = key(0, 0x40), KeyDel = key(0, 0x80),
Key9 = key(0, 0x10), KeyPlus = key(0, 0x20), KeyGBP = key(0, 0x40), KeyDelete = key(0, 0x80),
};
class UserPortVIA: public MOS::MOS6522<UserPortVIA> {

View File

@ -63,7 +63,6 @@
case VK_ANSI_I: _vic20.set_key_state(Vic20::Key::KeyI, isPressed); break;
case VK_ANSI_O: _vic20.set_key_state(Vic20::Key::KeyO, isPressed); break;
case VK_ANSI_P: _vic20.set_key_state(Vic20::Key::KeyP, isPressed); break;
case VK_ANSI_A: _vic20.set_key_state(Vic20::Key::KeyA, isPressed); break;
case VK_ANSI_S: _vic20.set_key_state(Vic20::Key::KeyS, isPressed); break;
case VK_ANSI_D: _vic20.set_key_state(Vic20::Key::KeyD, isPressed); break;
@ -73,7 +72,6 @@
case VK_ANSI_J: _vic20.set_key_state(Vic20::Key::KeyI, isPressed); break;
case VK_ANSI_K: _vic20.set_key_state(Vic20::Key::KeyK, isPressed); break;
case VK_ANSI_L: _vic20.set_key_state(Vic20::Key::KeyL, isPressed); break;
case VK_ANSI_Z: _vic20.set_key_state(Vic20::Key::KeyZ, isPressed); break;
case VK_ANSI_X: _vic20.set_key_state(Vic20::Key::KeyX, isPressed); break;
case VK_ANSI_C: _vic20.set_key_state(Vic20::Key::KeyC, isPressed); break;
@ -81,10 +79,57 @@
case VK_ANSI_B: _vic20.set_key_state(Vic20::Key::KeyB, isPressed); break;
case VK_ANSI_N: _vic20.set_key_state(Vic20::Key::KeyN, isPressed); break;
case VK_ANSI_M: _vic20.set_key_state(Vic20::Key::KeyM, isPressed); break;
case VK_Space: _vic20.set_key_state(Vic20::Key::KeySpace, isPressed); break;
case VK_Return: _vic20.set_key_state(Vic20::Key::KeyReturn, isPressed); break;
case VK_Delete: _vic20.set_key_state(Vic20::Key::KeyDelete, isPressed); break;
case VK_ANSI_Comma: _vic20.set_key_state(Vic20::Key::KeyComma, isPressed); break;
case VK_ANSI_Period: _vic20.set_key_state(Vic20::Key::KeyFullStop, isPressed); break;
case VK_ANSI_Minus: _vic20.set_key_state(Vic20::Key::KeyDash, isPressed); break;
case VK_ANSI_Equal: _vic20.set_key_state(Vic20::Key::KeyEquals, isPressed); break;
case VK_ANSI_Semicolon: _vic20.set_key_state(Vic20::Key::KeyColon, isPressed); break;
case VK_ANSI_Quote: _vic20.set_key_state(Vic20::Key::KeySemicolon, isPressed); break;
case VK_ANSI_Slash: _vic20.set_key_state(Vic20::Key::KeySlash, isPressed); break;
case VK_Shift:
// Yuck
_vic20.set_key_state(Vic20::Key::KeyLShift, isPressed);
_vic20.set_key_state(Vic20::Key::KeyRShift, isPressed);
break;
case VK_Option:
_vic20.set_key_state(Vic20::Key::KeyCBM, isPressed);
break;
case VK_Control:
_vic20.set_key_state(Vic20::Key::KeyControl, isPressed);
break;
// default: printf("%02x\n", key); break;
}
}
}
// Not yet mapped:
// KeyHome
// KeyF7
// KeyAt
// KeyUp
// KeyF5
// KeyF3
// KeyF1
// KeyRunStop
// KeyDown
// KeyRight
// KeyLeft
// KeyAsterisk
// KeyPlus
// KeyGBP
- (void)clearAllKeys {
}