mirror of
https://github.com/TomHarte/CLK.git
synced 2025-02-16 18:30:32 +00:00
Modifies mappings to improve key repeat on backspace and potentially allow mapping of other keys.
This commit is contained in:
parent
1f41d9c5f5
commit
32136b75cd
@ -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
|
||||
|
@ -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
|
||||
|
@ -67,7 +67,7 @@
|
||||
</Testables>
|
||||
</TestAction>
|
||||
<LaunchAction
|
||||
buildConfiguration = "Debug"
|
||||
buildConfiguration = "Release"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
enableASanStackUseAfterReturn = "YES"
|
||||
|
Loading…
x
Reference in New Issue
Block a user