From 6ad262128273c111df3def1acdbfea326e0a5cf5 Mon Sep 17 00:00:00 2001 From: tomcw Date: Sat, 16 Jun 2018 11:36:43 +0100 Subject: [PATCH] Fixed save-state not saving last key & update history.txt --- bin/History.txt | 9 +++++++++ source/Keyboard.cpp | 9 +++------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/bin/History.txt b/bin/History.txt index f121102d..ccf66a23 100644 --- a/bin/History.txt +++ b/bin/History.txt @@ -9,6 +9,15 @@ https://github.com/AppleWin/AppleWin/issues/new Tom Charlesworth +1.27.5.0 - dd mmm 2018 +---------------------- +. [Bug #556] Allow system key combinations to be read: Open Apple (left ALT) + ESC/SPACE/TAB. + - Also fixes #145, #198, #448. + - Support new command line switches: -no-hook-system-key, -alt-enter= + - Fix for save-state which wasn't correctly saving last key. +. [Bug #330] Any Key Down (AKD) wasn't working for the multi-key case. + + 1.27.4.0 - 26 May 2018 ---------------------- . [Bug #555] Fix for showing 559th DHGR vertical column. diff --git a/source/Keyboard.cpp b/source/Keyboard.cpp index 70146809..14341ec4 100644 --- a/source/Keyboard.cpp +++ b/source/Keyboard.cpp @@ -51,11 +51,8 @@ static bool g_bCapsLock = true; //Caps lock key for Apple2 and Lat/Cyr lock for static bool g_bP8CapsLock = true; //Caps lock key of Pravets 8A/C static int lastvirtkey = 0; // Current PC keycode static BYTE keycode = 0; // Current Apple keycode - static BOOL keywaiting = 0; -static BYTE g_nLastKey = 0x00; - // // ----- ALL GLOBALLY ACCESSIBLE FUNCTIONS ARE BELOW THIS LINE ----- // @@ -513,7 +510,7 @@ void KeybToggleP8ACapsLock () void KeybSetSnapshot_v1(const BYTE LastKey) { - g_nLastKey = LastKey; + keycode = LastKey; } // @@ -529,7 +526,7 @@ static std::string KeybGetSnapshotStructName(void) void KeybSaveSnapshot(YamlSaveHelper& yamlSaveHelper) { YamlSaveHelper::Label state(yamlSaveHelper, "%s:\n", KeybGetSnapshotStructName().c_str()); - yamlSaveHelper.SaveHexUint8(SS_YAML_KEY_LASTKEY, g_nLastKey); + yamlSaveHelper.SaveHexUint8(SS_YAML_KEY_LASTKEY, keycode); } void KeybLoadSnapshot(YamlLoadHelper& yamlLoadHelper) @@ -537,7 +534,7 @@ void KeybLoadSnapshot(YamlLoadHelper& yamlLoadHelper) if (!yamlLoadHelper.GetSubMap(KeybGetSnapshotStructName())) return; - g_nLastKey = (BYTE) yamlLoadHelper.LoadUint(SS_YAML_KEY_LASTKEY); + keycode = (BYTE) yamlLoadHelper.LoadUint(SS_YAML_KEY_LASTKEY); yamlLoadHelper.PopMap(); }