1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-07-02 20:30:00 +00:00

Modifies mappings to improve key repeat on backspace and potentially allow mapping of other keys.

This commit is contained in:
Thomas Harte 2020-03-02 23:10:18 -05:00
parent 1f41d9c5f5
commit 32136b75cd
3 changed files with 11 additions and 5 deletions

View File

@ -13,7 +13,9 @@ using namespace AmstradCPC;
uint16_t KeyboardMapper::mapped_key_for_key(Inputs::Keyboard::Key key) {
#define BIND(source, dest) case Inputs::Keyboard::Key::source: return dest
switch(key) {
default: return KeyCopy;
default: break;
BIND(BackTick, KeyCopy);
BIND(k0, Key0); BIND(k1, Key1); BIND(k2, Key2); BIND(k3, Key3); BIND(k4, Key4);
BIND(k5, Key5); BIND(k6, Key6); BIND(k7, Key7); BIND(k8, Key8); BIND(k9, Key9);
@ -72,6 +74,7 @@ uint16_t KeyboardMapper::mapped_key_for_key(Inputs::Keyboard::Key key) {
BIND(KeypadDelete, KeyDelete);
}
#undef BIND
return KeyboardMachine::MappedMachine::KeyNotMapped;
}
uint16_t *CharacterMapper::sequence_for_character(char character) {
@ -142,7 +145,7 @@ uint16_t *CharacterMapper::sequence_for_character(char character) {
/* x */ KEYS(KeyX), /* y */ KEYS(KeyY),
/* z */ KEYS(KeyZ), /* { */ X,
/* | */ SHIFT(KeyAt), /* } */ X,
/* ~ */ X, /* DEL */ KEYS(KeyDelete),
/* ~ */ X
};
#undef KEYS
#undef SHIFT

View File

@ -13,7 +13,9 @@ using namespace Electron;
uint16_t KeyboardMapper::mapped_key_for_key(Inputs::Keyboard::Key key) {
#define BIND(source, dest) case Inputs::Keyboard::Key::source: return Electron::Key::dest
switch(key) {
default: return KeyCopy;
default: break;
BIND(BackTick, KeyCopy);
BIND(k0, Key0); BIND(k1, Key1); BIND(k2, Key2); BIND(k3, Key3); BIND(k4, Key4);
BIND(k5, Key5); BIND(k6, Key6); BIND(k7, Key7); BIND(k8, Key8); BIND(k9, Key9);
@ -52,6 +54,7 @@ uint16_t KeyboardMapper::mapped_key_for_key(Inputs::Keyboard::Key key) {
BIND(Space, KeySpace);
}
#undef BIND
return KeyboardMachine::MappedMachine::KeyNotMapped;
}
uint16_t *CharacterMapper::sequence_for_character(char character) {
@ -123,7 +126,7 @@ uint16_t *CharacterMapper::sequence_for_character(char character) {
/* x */ SHIFT(KeyX), /* y */ SHIFT(KeyY),
/* z */ SHIFT(KeyZ), /* { */ CTRL(KeyUp),
/* | */ SHIFT(KeyRight), /* } */ CTRL(KeyDown),
/* ~ */ CTRL(KeyLeft), /* DEL */ KEYS(KeyDelete),
/* ~ */ CTRL(KeyLeft)
};
#undef KEYS
#undef SHIFT

View File

@ -67,7 +67,7 @@
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
buildConfiguration = "Release"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
enableASanStackUseAfterReturn = "YES"