From 4e8d9e311e5bbb529c5c4b1062dbe6a690cada3d Mon Sep 17 00:00:00 2001 From: Jonghyeon Park Date: Fri, 25 Oct 2024 15:12:36 +0900 Subject: [PATCH] feat: complete load value from controller --- configurator/lib/globals.dart | 1 + configurator/lib/models/key_config.dart | 6 ++++-- controller/const.h | 3 ++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/configurator/lib/globals.dart b/configurator/lib/globals.dart index 4e3a519..50f9e5c 100644 --- a/configurator/lib/globals.dart +++ b/configurator/lib/globals.dart @@ -210,6 +210,7 @@ class Globals { return null; } keyConfig = serialLoadSavedKeyConfigurationResult.data!; + requestRefreshKeyConfigValueDisplayerWithKey(); return keyConfig; } diff --git a/configurator/lib/models/key_config.dart b/configurator/lib/models/key_config.dart index c2b9a28..bef06c9 100644 --- a/configurator/lib/models/key_config.dart +++ b/configurator/lib/models/key_config.dart @@ -145,9 +145,11 @@ class KeyConfig implements KeyConfigStructure { return Function.apply( KeyConfig.new, list.map((each) { + print('keycode: ${ArduinoKeycode.toKey(each)}'); + print('keycode: ${each != Keycode.undefined}'); return EachKeyConfig( - keycode: ArduinoKeycode.toKey(each % (1 << 8)), - enabled: (each / (1 << 8) == 0)); + keycode: ArduinoKeycode.toKey(each), + enabled: each != Keycode.undefined); }).toList()) as KeyConfig; } diff --git a/controller/const.h b/controller/const.h index 45cabad..9f653f8 100644 --- a/controller/const.h +++ b/controller/const.h @@ -1,6 +1,7 @@ #ifndef CONST #define CONST -#define undefined (int)-1e8 +#define keyconfig_disabled (1 << 7) +#define undefined keyconfig_disabled #endif