diff --git a/Machines/Acorn/BBCMicro/Keyboard.hpp b/Machines/Acorn/BBCMicro/Keyboard.hpp index 59a062f3e..ebca423b5 100644 --- a/Machines/Acorn/BBCMicro/Keyboard.hpp +++ b/Machines/Acorn/BBCMicro/Keyboard.hpp @@ -49,13 +49,13 @@ enum class Key: uint16_t { // // Break; a key, but not on the keyboard matrix. // - Break = 0xfffc, + Break = 0xfe00, // // Fictional keys to aid key entry. // - SwitchOffCaps = 0xfffb, - RestoreCaps = 0xfffa, + SwitchOffCaps = 0xfe01, + RestoreCaps = 0xfe02, // // Master only keys. diff --git a/Machines/Acorn/Electron/Keyboard.hpp b/Machines/Acorn/Electron/Keyboard.hpp index 1b1baf20e..840121013 100644 --- a/Machines/Acorn/Electron/Keyboard.hpp +++ b/Machines/Acorn/Electron/Keyboard.hpp @@ -30,9 +30,8 @@ enum Key: uint16_t { KeyShift = 0x00d0 | 0x08, KeyControl = 0x00d0 | 0x04, KeyFunc = 0x00d0 | 0x02, KeyEscape = 0x00d0 | 0x01, // Virtual keys. - KeyF1 = 0xfff0, KeyF2, KeyF3, KeyF4, KeyF5, KeyF6, KeyF7, KeyF8, KeyF9, KeyF0, - - KeyBreak = 0xfffc, + KeyF1 = 0xfe00, KeyF2, KeyF3, KeyF4, KeyF5, KeyF6, KeyF7, KeyF8, KeyF9, KeyF0, + KeyBreak, }; constexpr bool is_modifier(const Key key) { diff --git a/Machines/Commodore/Vic-20/Keyboard.hpp b/Machines/Commodore/Vic-20/Keyboard.hpp index 2d2eca599..9530448e8 100644 --- a/Machines/Commodore/Vic-20/Keyboard.hpp +++ b/Machines/Commodore/Vic-20/Keyboard.hpp @@ -36,15 +36,15 @@ enum Key: uint16_t { Key9 = key(0, 0x10), KeyPlus = key(0, 0x20), KeyGBP = key(0, 0x40), KeyDelete = key(0, 0x80), // Virtual keys. - KeyUp = 0xfff0, - KeyLeft = 0xfff1, - KeyF2 = 0xfff2, - KeyF4 = 0xfff3, - KeyF6 = 0xfff4, - KeyF8 = 0xfff5, + KeyUp = 0xfe00, + KeyLeft, + KeyF2, + KeyF4, + KeyF6, + KeyF8, // Physical keys not within the usual matrix. - KeyRestore = 0xfffc, + KeyRestore, }; struct KeyboardMapper: public MachineTypes::MappedKeyboardMachine::KeyboardMapper { diff --git a/Machines/Oric/Keyboard.hpp b/Machines/Oric/Keyboard.hpp index e7173f9ca..bc16d1cdf 100644 --- a/Machines/Oric/Keyboard.hpp +++ b/Machines/Oric/Keyboard.hpp @@ -31,8 +31,8 @@ enum Key: uint16_t { KeyEquals = 0x0700 | 0x80, KeyReturn = 0x0700 | 0x20, KeyRightShift = 0x0700 | 0x10, KeyForwardSlash = 0x0700 | 0x08, Key0 = 0x0700 | 0x04, KeyL = 0x0700 | 0x02, Key8 = 0x0700 | 0x01, - KeyNMI = 0xfffc, - KeyJasminReset = 0xfffb, + KeyNMI = 0xfe00, + KeyJasminReset, }; struct KeyboardMapper: public MachineTypes::MappedKeyboardMachine::KeyboardMapper { diff --git a/Machines/Utility/Typer.cpp b/Machines/Utility/Typer.cpp index 9893987cb..f69b1b904 100644 --- a/Machines/Utility/Typer.cpp +++ b/Machines/Utility/Typer.cpp @@ -107,15 +107,12 @@ uint16_t Typer::try_type_next_character() { ++phase_; } - // If the sequence is over, stop. - if(sequence[phase_ - 2] == MachineTypes::MappedKeyboardMachine::KeyEndSequence) { - return MachineTypes::MappedKeyboardMachine::KeyEndSequence; + // Don't forward ::KeyEndSequence. + const auto next = sequence[phase_ - 2]; + if(next != MachineTypes::MappedKeyboardMachine::KeyEndSequence) { + delegate_->set_key_state(sequence[phase_ - 2], true); } - - // Otherwise, type the key. - delegate_->set_key_state(sequence[phase_ - 2], true); - - return sequence[phase_ - 2]; + return next; } bool Typer::type_next_character() {