Skip to content

Commit

Permalink
Implement Forced Setup Mode & Hotkey Lock settings (#273)
Browse files Browse the repository at this point in the history
* Implement Forced Setup Mode & Hotkey lock settings

* Rename enums

* Add warning to web-config for Forced Setup Mode

* Update warning check text

* Fix BoardConfig.h
  • Loading branch information
deeebug authored May 29, 2023
1 parent 4fc2d73 commit 8221d2f
Show file tree
Hide file tree
Showing 25 changed files with 181 additions and 35 deletions.
2 changes: 2 additions & 0 deletions configs/BentoBox/BoardConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@
#define SLIDER_SOCD_SLOT_TWO SOCD_MODE_SECOND_INPUT_PRIORITY
#define SLIDER_SOCD_SLOT_DEFAULT SOCD_MODE_NEUTRAL

#define DEFAULT_FORCED_SETUP_MODE FORCED_SETUP_MODE_OFF // FORCED_SETUP_MODE_OFF, FORCED_SETUP_MODE_LOCK_MODE_SWITCH, FORCED_SETUP_MODE_LOCK_WEB_CONFIG, FORCED_SETUP_MODE_LOCK_BOTH
#define DEFAULT_LOCK_HOTKEYS false // or true

// This is the LEDs section.
// The default `TURBO_LED_PIN` pin is set to `15` ( it is recommended to run through 3V3(OUT) with a resistor)
Expand Down
2 changes: 2 additions & 0 deletions configs/DURAL/BoardConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@
#define SLIDER_SOCD_SLOT_TWO SOCD_MODE_SECOND_INPUT_PRIORITY
#define SLIDER_SOCD_SLOT_DEFAULT SOCD_MODE_NEUTRAL

#define DEFAULT_FORCED_SETUP_MODE FORCED_SETUP_MODE_OFF // FORCED_SETUP_MODE_OFF, FORCED_SETUP_MODE_LOCK_MODE_SWITCH, FORCED_SETUP_MODE_LOCK_WEB_CONFIG, FORCED_SETUP_MODE_LOCK_BOTH
#define DEFAULT_LOCK_HOTKEYS false // or true

// This is the LEDs section.
// The default `TURBO_LED_PIN` pin is set to `15` ( it is recommended to run through 3V3(OUT) with a resistor)
Expand Down
2 changes: 2 additions & 0 deletions configs/FightboardV3/BoardConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@
#define SLIDER_SOCD_SLOT_TWO SOCD_MODE_SECOND_INPUT_PRIORITY
#define SLIDER_SOCD_SLOT_DEFAULT SOCD_MODE_NEUTRAL

#define DEFAULT_FORCED_SETUP_MODE FORCED_SETUP_MODE_OFF // FORCED_SETUP_MODE_OFF, FORCED_SETUP_MODE_LOCK_MODE_SWITCH, FORCED_SETUP_MODE_LOCK_WEB_CONFIG, FORCED_SETUP_MODE_LOCK_BOTH
#define DEFAULT_LOCK_HOTKEYS false // or true

// This is the LEDs section.
// The default `TURBO_LED_PIN` pin is set to `15` ( it is recommended to run through 3V3(OUT) with a resistor)
Expand Down
2 changes: 2 additions & 0 deletions configs/FightboardV3Mirrored/BoardConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@
#define SLIDER_SOCD_SLOT_TWO SOCD_MODE_SECOND_INPUT_PRIORITY
#define SLIDER_SOCD_SLOT_DEFAULT SOCD_MODE_NEUTRAL

#define DEFAULT_FORCED_SETUP_MODE FORCED_SETUP_MODE_OFF // FORCED_SETUP_MODE_OFF, FORCED_SETUP_MODE_LOCK_MODE_SWITCH, FORCED_SETUP_MODE_LOCK_WEB_CONFIG, FORCED_SETUP_MODE_LOCK_BOTH
#define DEFAULT_LOCK_HOTKEYS false // or true

// This is the LEDs section.
// The default `TURBO_LED_PIN` pin is set to `15` ( it is recommended to run through 3V3(OUT) with a resistor)
Expand Down
2 changes: 2 additions & 0 deletions configs/FlatboxRev4/BoardConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@
#define SLIDER_SOCD_SLOT_TWO SOCD_MODE_SECOND_INPUT_PRIORITY
#define SLIDER_SOCD_SLOT_DEFAULT SOCD_MODE_NEUTRAL

#define DEFAULT_FORCED_SETUP_MODE FORCED_SETUP_MODE_OFF // FORCED_SETUP_MODE_OFF, FORCED_SETUP_MODE_LOCK_MODE_SWITCH, FORCED_SETUP_MODE_LOCK_WEB_CONFIG, FORCED_SETUP_MODE_LOCK_BOTH
#define DEFAULT_LOCK_HOTKEYS false // or true

// This is the LEDs section.
// The default `TURBO_LED_PIN` pin is set to `15` ( it is recommended to run through 3V3(OUT) with a resistor)
Expand Down
2 changes: 2 additions & 0 deletions configs/FlatboxRev5/BoardConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@
#define SLIDER_SOCD_SLOT_TWO SOCD_MODE_SECOND_INPUT_PRIORITY
#define SLIDER_SOCD_SLOT_DEFAULT SOCD_MODE_NEUTRAL

#define DEFAULT_FORCED_SETUP_MODE FORCED_SETUP_MODE_OFF // FORCED_SETUP_MODE_OFF, FORCED_SETUP_MODE_LOCK_MODE_SWITCH, FORCED_SETUP_MODE_LOCK_WEB_CONFIG, FORCED_SETUP_MODE_LOCK_BOTH
#define DEFAULT_LOCK_HOTKEYS false // or true

// This is the LEDs section.
// The default `TURBO_LED_PIN` pin is set to `15` ( it is recommended to run through 3V3(OUT) with a resistor)
Expand Down
5 changes: 4 additions & 1 deletion configs/KB2040/BoardConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,13 @@
#define SLIDER_SOCD_SLOT_TWO SOCD_MODE_SECOND_INPUT_PRIORITY
#define SLIDER_SOCD_SLOT_DEFAULT SOCD_MODE_NEUTRAL

#define DEFAULT_FORCED_SETUP_MODE FORCED_SETUP_MODE_OFF // FORCED_SETUP_MODE_OFF, FORCED_SETUP_MODE_LOCK_MODE_SWITCH, FORCED_SETUP_MODE_LOCK_WEB_CONFIG, FORCED_SETUP_MODE_LOCK_BOTH
#define DEFAULT_LOCK_HOTKEYS false // or true
#define DEFAULT_INPUT_MODE INPUT_MODE_XINPUT //INPUT_MODE_XINPUT (XInput), INPUT_MODE_SWITCH (Nintendo Switch), INPUT_MODE_HID (D-Input), INPUT_MODE_KEYBOARD (Keyboard)
#define DEFAULT_DPAD_MODE DPAD_MODE_DIGITAL //DPAD_MODE_DIGITAL, DPAD_MODE_LEFT_ANALOG, DPAD_MODE_RIGHT_ANALOG,

// This is the LEDs section.
#define DEFAULT_FORCED_SETUP_MODE FORCED_SETUP_MODE_OFF
#define DEFAULT_LOCK_HOTKEYS false// This is the LEDs section.
// The default `TURBO_LED_PIN` pin is set to `15` ( it is recommended to run through 3V3(OUT) with a resistor)
// The Turbo LED will flash at a speed consistant with the set speed of the Turbo when a Turbo button is active.
// It is recommended to disable the `TURBO_LED_PIN` by setting it to `-1` if you are sensitive of flashing lights.
Expand Down
2 changes: 2 additions & 0 deletions configs/MavercadeKeebfighter/BoardConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@
#define SLIDER_SOCD_SLOT_TWO SOCD_MODE_SECOND_INPUT_PRIORITY
#define SLIDER_SOCD_SLOT_DEFAULT SOCD_MODE_NEUTRAL

#define DEFAULT_FORCED_SETUP_MODE FORCED_SETUP_MODE_OFF // FORCED_SETUP_MODE_OFF, FORCED_SETUP_MODE_LOCK_MODE_SWITCH, FORCED_SETUP_MODE_LOCK_WEB_CONFIG, FORCED_SETUP_MODE_LOCK_BOTH
#define DEFAULT_LOCK_HOTKEYS false // or true

// This is the LEDs section.
// The default `TURBO_LED_PIN` pin is set to `15` ( it is recommended to run through 3V3(OUT) with a resistor)
Expand Down
3 changes: 3 additions & 0 deletions configs/Pico/BoardConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@
#define SLIDER_SOCD_SLOT_TWO SOCD_MODE_SECOND_INPUT_PRIORITY
#define SLIDER_SOCD_SLOT_DEFAULT SOCD_MODE_NEUTRAL

#define DEFAULT_FORCED_SETUP_MODE FORCED_SETUP_MODE_OFF // FORCED_SETUP_MODE_OFF, FORCED_SETUP_MODE_LOCK_MODE_SWITCH, FORCED_SETUP_MODE_LOCK_WEB_CONFIG, FORCED_SETUP_MODE_LOCK_BOTH
#define DEFAULT_LOCK_HOTKEYS false // or true

#define DEFAULT_INPUT_MODE INPUT_MODE_XINPUT //INPUT_MODE_XINPUT (XInput), INPUT_MODE_SWITCH (Nintendo Switch), INPUT_MODE_HID (D-Input), INPUT_MODE_KEYBOARD (Keyboard)
#define DEFAULT_DPAD_MODE DPAD_MODE_DIGITAL //DPAD_MODE_DIGITAL, DPAD_MODE_LEFT_ANALOG, DPAD_MODE_RIGHT_ANALOG,

Expand Down
2 changes: 2 additions & 0 deletions configs/PicoAnn/BoardConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@
#define SLIDER_SOCD_SLOT_TWO SOCD_MODE_SECOND_INPUT_PRIORITY
#define SLIDER_SOCD_SLOT_DEFAULT SOCD_MODE_NEUTRAL

#define DEFAULT_FORCED_SETUP_MODE FORCED_SETUP_MODE_OFF // FORCED_SETUP_MODE_OFF, FORCED_SETUP_MODE_LOCK_MODE_SWITCH, FORCED_SETUP_MODE_LOCK_WEB_CONFIG, FORCED_SETUP_MODE_LOCK_BOTH
#define DEFAULT_LOCK_HOTKEYS false // or true

// This is the LEDs section.
// The default `TURBO_LED_PIN` pin is set to `15` ( it is recommended to run through 3V3(OUT) with a resistor)
Expand Down
2 changes: 2 additions & 0 deletions configs/PicoFightingBoard/BoardConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@
#define SLIDER_SOCD_SLOT_TWO SOCD_MODE_SECOND_INPUT_PRIORITY
#define SLIDER_SOCD_SLOT_DEFAULT SOCD_MODE_NEUTRAL

#define DEFAULT_FORCED_SETUP_MODE FORCED_SETUP_MODE_OFF // FORCED_SETUP_MODE_OFF, FORCED_SETUP_MODE_LOCK_MODE_SWITCH, FORCED_SETUP_MODE_LOCK_WEB_CONFIG, FORCED_SETUP_MODE_LOCK_BOTH
#define DEFAULT_LOCK_HOTKEYS false // or true

// This is the LEDs section.
// The default `TURBO_LED_PIN` pin is set to `15` ( it is recommended to run through 3V3(OUT) with a resistor)
Expand Down
2 changes: 2 additions & 0 deletions configs/RP2040AdvancedBreakoutBoard/BoardConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@
#define SLIDER_SOCD_SLOT_TWO SOCD_MODE_SECOND_INPUT_PRIORITY
#define SLIDER_SOCD_SLOT_DEFAULT SOCD_MODE_NEUTRAL

#define DEFAULT_FORCED_SETUP_MODE FORCED_SETUP_MODE_OFF // FORCED_SETUP_MODE_OFF, FORCED_SETUP_MODE_LOCK_MODE_SWITCH, FORCED_SETUP_MODE_LOCK_WEB_CONFIG, FORCED_SETUP_MODE_LOCK_BOTH
#define DEFAULT_LOCK_HOTKEYS false // or true

// This is the LEDs section.
// The default `TURBO_LED_PIN` pin is set to `15` ( it is recommended to run through 3V3(OUT) with a resistor)
Expand Down
2 changes: 2 additions & 0 deletions configs/ReflexEncoder/BoardConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@
#define SLIDER_SOCD_SLOT_TWO SOCD_MODE_SECOND_INPUT_PRIORITY
#define SLIDER_SOCD_SLOT_DEFAULT SOCD_MODE_NEUTRAL

#define DEFAULT_FORCED_SETUP_MODE FORCED_SETUP_MODE_OFF // FORCED_SETUP_MODE_OFF, FORCED_SETUP_MODE_LOCK_MODE_SWITCH, FORCED_SETUP_MODE_LOCK_WEB_CONFIG, FORCED_SETUP_MODE_LOCK_BOTH
#define DEFAULT_LOCK_HOTKEYS false // or true

// This is the LEDs section.
// The default `TURBO_LED_PIN` pin is set to `15` ( it is recommended to run through 3V3(OUT) with a resistor)
Expand Down
2 changes: 2 additions & 0 deletions configs/SparkFunProMicro/BoardConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@
#define SLIDER_SOCD_SLOT_TWO SOCD_MODE_SECOND_INPUT_PRIORITY
#define SLIDER_SOCD_SLOT_DEFAULT SOCD_MODE_NEUTRAL

#define DEFAULT_FORCED_SETUP_MODE FORCED_SETUP_MODE_OFF // FORCED_SETUP_MODE_OFF, FORCED_SETUP_MODE_LOCK_MODE_SWITCH, FORCED_SETUP_MODE_LOCK_WEB_CONFIG, FORCED_SETUP_MODE_LOCK_BOTH
#define DEFAULT_LOCK_HOTKEYS false // or true
// This is the LEDs section.
// The default `TURBO_LED_PIN` pin is set to `15` ( it is recommended to run through 3V3(OUT) with a resistor)
// The Turbo LED will flash at a speed consistant with the set speed of the Turbo when a Turbo button is active.
Expand Down
2 changes: 2 additions & 0 deletions configs/WaveshareZero/BoardConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@
#define SLIDER_SOCD_SLOT_TWO SOCD_MODE_SECOND_INPUT_PRIORITY
#define SLIDER_SOCD_SLOT_DEFAULT SOCD_MODE_NEUTRAL

#define DEFAULT_FORCED_SETUP_MODE FORCED_SETUP_MODE_OFF // FORCED_SETUP_MODE_OFF, FORCED_SETUP_MODE_LOCK_MODE_SWITCH, FORCED_SETUP_MODE_LOCK_WEB_CONFIG, FORCED_SETUP_MODE_LOCK_BOTH
#define DEFAULT_LOCK_HOTKEYS false // or true

// This is the LEDs section.
// The default `TURBO_LED_PIN` pin is set to `15` ( it is recommended to run through 3V3(OUT) with a resistor)
Expand Down
Empty file.
1 change: 1 addition & 0 deletions headers/storagemanager.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ class Storage {
Config& getConfig() { return config; }
GamepadOptions& getGamepadOptions() { return config.gamepadOptions; }
HotkeyOptions& getHotkeyOptions() { return config.hotkeyOptions; }
ForcedSetupOptions& getForcedSetupOptions() { return config.forcedSetupOptions; }
PinMappings& getPinMappings() { return config.pinMappings; }
KeyboardMapping& getKeyboardMapping() { return config.keyboardMapping; }
DisplayOptions& getDisplayOptions() { return config.displayOptions; }
Expand Down
7 changes: 7 additions & 0 deletions proto/config.proto
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ message GamepadOptions
optional bool invertXAxis = 4;
optional bool invertYAxis = 5;
optional bool switchTpShareForDs4 = 6;
optional bool lockHotkeys = 7;
}

message KeyboardMapping
Expand Down Expand Up @@ -53,6 +54,11 @@ message HotkeyOptions
optional HotkeyEntry hotkeyF2Right = 8;
}

message ForcedSetupOptions
{
optional ForcedSetupMode mode = 1;
};

message ButtonLayoutParamsCommon
{
optional int32 startX = 1;
Expand Down Expand Up @@ -401,4 +407,5 @@ message Config
optional LEDOptions ledOptions = 7;
optional AnimationOptions_Proto animationOptions = 8;
optional AddonOptions addonOptions = 9;
optional ForcedSetupOptions forcedSetupOptions = 10;
}
10 changes: 10 additions & 0 deletions proto/enums.proto
Original file line number Diff line number Diff line change
Expand Up @@ -151,3 +151,13 @@ enum PLEDType
PLED_TYPE_PWM = 0;
PLED_TYPE_RGB = 1;
};

enum ForcedSetupMode
{
option (nanopb_enumopt).long_names = false;

FORCED_SETUP_MODE_OFF = 0;
FORCED_SETUP_MODE_LOCK_MODE_SWITCH = 1;
FORCED_SETUP_MODE_LOCK_WEB_CONFIG = 2;
FORCED_SETUP_MODE_LOCK_BOTH = 3;
};
4 changes: 4 additions & 0 deletions src/config_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ void ConfigUtils::initUnsetPropertiesWithDefaults(Config& config)
INIT_UNSET_PROPERTY(config.gamepadOptions, socdMode, DEFAULT_SOCD_MODE);
INIT_UNSET_PROPERTY(config.gamepadOptions, invertXAxis, false);
INIT_UNSET_PROPERTY(config.gamepadOptions, switchTpShareForDs4, false);
INIT_UNSET_PROPERTY(config.gamepadOptions, lockHotkeys, DEFAULT_LOCK_HOTKEYS);

// hotkeyOptions
HotkeyOptions& hotkeyOptions = config.hotkeyOptions;
Expand All @@ -110,6 +111,9 @@ void ConfigUtils::initUnsetPropertiesWithDefaults(Config& config)
INIT_UNSET_PROPERTY(hotkeyOptions.hotkeyF2Right, dpadMask, HOTKEY_F2_RIGHT_MASK);
INIT_UNSET_PROPERTY(hotkeyOptions.hotkeyF2Right, action, HOTKEY_F2_RIGHT_ACTION);

// forcedSetupMode
INIT_UNSET_PROPERTY(config.forcedSetupOptions, mode, DEFAULT_FORCED_SETUP_MODE);

// pinMappings
INIT_UNSET_PROPERTY(config.pinMappings, pinDpadUp, PIN_DPAD_UP);
INIT_UNSET_PROPERTY(config.pinMappings, pinDpadDown, PIN_DPAD_DOWN);
Expand Down
7 changes: 7 additions & 0 deletions src/configs/webconfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,7 @@ std::string setGamepadOptions()
readDoc(gamepadOptions.inputMode, doc, "inputMode");
readDoc(gamepadOptions.socdMode, doc, "socdMode");
readDoc(gamepadOptions.switchTpShareForDs4, doc, "switchTpShareForDs4");
readDoc(gamepadOptions.lockHotkeys, doc, "lockHotkeys");

HotkeyOptions& hotkeyOptions = Storage::getInstance().getHotkeyOptions();
readDoc(hotkeyOptions.hotkeyF1Up.action, doc, "hotkeyF1", 0, "action");
Expand All @@ -467,6 +468,9 @@ std::string setGamepadOptions()
readDoc(hotkeyOptions.hotkeyF2Left.action, doc, "hotkeyF2", 2, "action");
readDoc(hotkeyOptions.hotkeyF2Right.action, doc, "hotkeyF2", 3, "action");

ForcedSetupOptions& forcedSetupOptions = Storage::getInstance().getForcedSetupOptions();
readDoc(forcedSetupOptions.mode, doc, "forcedSetupMode");

Storage::getInstance().save();

return serialize_json(doc);
Expand All @@ -481,6 +485,7 @@ std::string getGamepadOptions()
writeDoc(doc, "inputMode", gamepadOptions.inputMode);
writeDoc(doc, "socdMode", gamepadOptions.socdMode);
writeDoc(doc, "switchTpShareForDs4", gamepadOptions.switchTpShareForDs4 ? 1 : 0);
writeDoc(doc, "lockHotkeys", gamepadOptions.lockHotkeys ? 1 : 0);

HotkeyOptions& hotkeyOptions = Storage::getInstance().getHotkeyOptions();
writeDoc(doc, "hotkeyF1", 0, "action", hotkeyOptions.hotkeyF1Up.action);
Expand All @@ -501,6 +506,8 @@ std::string getGamepadOptions()
writeDoc(doc, "hotkeyF2", 3, "action", hotkeyOptions.hotkeyF2Right.action);
writeDoc(doc, "hotkeyF2", 3, "mask", hotkeyOptions.hotkeyF2Right.dpadMask);

ForcedSetupOptions& forcedSetupOptions = Storage::getInstance().getForcedSetupOptions();
writeDoc(doc, "forcedSetupMode", forcedSetupOptions.mode);
return serialize_json(doc);
}

Expand Down
2 changes: 2 additions & 0 deletions src/gamepad.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,8 @@ void Gamepad::save()

GamepadHotkey Gamepad::hotkey()
{
if (options.lockHotkeys) return HOTKEY_NONE;

static GamepadHotkey lastAction = HOTKEY_NONE;
GamepadHotkey action = HOTKEY_NONE;
if (pressedF1())
Expand Down
20 changes: 14 additions & 6 deletions src/gp2040.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include "gp2040.h"
#include "helper.h"
#include "system.h"
#include "enums.pb.h"

#include "configmanager.h" // Global Managers
#include "storagemanager.h"
Expand Down Expand Up @@ -178,19 +179,26 @@ GP2040::BootAction GP2040::getBootAction() {
Gamepad * gamepad = Storage::getInstance().GetGamepad();
gamepad->read();

ForcedSetupOptions& forcedSetupOptions = Storage::getInstance().getForcedSetupOptions();
bool modeSwitchLocked = forcedSetupOptions.mode == FORCED_SETUP_MODE_LOCK_MODE_SWITCH ||
forcedSetupOptions.mode == FORCED_SETUP_MODE_LOCK_BOTH;

bool webConfigLocked = forcedSetupOptions.mode == FORCED_SETUP_MODE_LOCK_WEB_CONFIG ||
forcedSetupOptions.mode == FORCED_SETUP_MODE_LOCK_BOTH;

if (gamepad->pressedF1() && gamepad->pressedUp()) {
return BootAction::ENTER_USB_MODE;
} else if (gamepad->pressedS2()) {
} else if (!webConfigLocked && gamepad->pressedS2()) {
return BootAction::ENTER_WEBCONFIG_MODE;
} else if (gamepad->pressedB3()) { // P1
} else if (!modeSwitchLocked && gamepad->pressedB3()) { // P1
return BootAction::SET_INPUT_MODE_HID;
} else if (gamepad->pressedB4()) { // P2
} else if (!modeSwitchLocked && gamepad->pressedB4()) { // P2
return BootAction::SET_INPUT_MODE_PS4;
} else if (gamepad->pressedB1()) { // K1
} else if (!modeSwitchLocked && gamepad->pressedB1()) { // K1
return BootAction::SET_INPUT_MODE_SWITCH;
} else if (gamepad->pressedB2()) { // K2
} else if (!modeSwitchLocked && gamepad->pressedB2()) { // K2
return BootAction::SET_INPUT_MODE_XINPUT;
} else if (gamepad->pressedR2()) { // K3
} else if (!modeSwitchLocked && gamepad->pressedR2()) { // K3
return BootAction::SET_INPUT_MODE_KEYBOARD;
} else {
return BootAction::NONE;
Expand Down
2 changes: 2 additions & 0 deletions www/server/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ app.get("/api/getGamepadOptions", (req, res) => {
inputMode: 4,
socdMode: 2,
switchTpShareForDs4: 0,
forcedSetupMode: 0,
lockHotkeys: 0,
hotkeyF1: [
{ action: 1, mask: 1<<0 },
{ action: 2, mask: 1<<1 },
Expand Down
Loading

0 comments on commit 8221d2f

Please sign in to comment.