Skip to content

Commit

Permalink
add a hotkey to force a save of the config
Browse files Browse the repository at this point in the history
  • Loading branch information
bsstephan committed Oct 4, 2024
1 parent 2e9c124 commit 4e54d50
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions proto/enums.proto
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,7 @@ enum GamepadHotkey
HOTKEY_DPAD_LEFT = 40;
HOTKEY_DPAD_RIGHT = 41;
HOTKEY_PREVIOUS_PROFILE = 42;
HOTKEY_SAVE_CONFIG = 43;
}

// This has to be kept in sync with LEDFormat in NeoPico.hpp
Expand Down
3 changes: 3 additions & 0 deletions src/gamepad.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,9 @@ void Gamepad::processHotkeyAction(GamepadHotkey action) {
case HOTKEY_REBOOT_DEFAULT:
System::reboot(System::BootMode::DEFAULT);
break;
case HOTKEY_SAVE_CONFIG:
Storage::getInstance().save(true);
break;
case HOTKEY_CAPTURE_BUTTON:
state.buttons |= GAMEPAD_MASK_A2;
break;
Expand Down
1 change: 1 addition & 0 deletions www/src/Locales/en/SettingsPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ export default {
'load-profile-3': 'Load Profile #3',
'load-profile-4': 'Load Profile #4',
'reboot-default': 'Reboot GP2040-CE',
'save-config': 'Save Config',
'next-profile': 'Next Profile',
'previous-profile': 'Previous Profile',
},
Expand Down
1 change: 1 addition & 0 deletions www/src/Pages/SettingsPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@ const HOTKEY_ACTIONS = [
{ labelKey: 'hotkey-actions.r3-button', value: 20 },
{ labelKey: 'hotkey-actions.touchpad-button', value: 21 },
{ labelKey: 'hotkey-actions.reboot-default', value: 22 },
{ labelKey: 'hotkey-actions.save-config', value: 43 },
{ labelKey: 'hotkey-actions.b1-button', value: 23 },
{ labelKey: 'hotkey-actions.b2-button', value: 24 },
{ labelKey: 'hotkey-actions.b3-button', value: 25 },
Expand Down

0 comments on commit 4e54d50

Please sign in to comment.