Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add dpad directions to hotkeys #1111

Merged
merged 1 commit into from
Aug 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions proto/enums.proto
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ enum SplashChoice
enum OnBoardLedMode
{
option (nanopb_enumopt).long_names = false;

ON_BOARD_LED_MODE_OFF = 0;
ON_BOARD_LED_MODE_MODE_INDICATOR = 1;
ON_BOARD_LED_MODE_INPUT_TEST = 2;
Expand Down Expand Up @@ -295,6 +295,10 @@ enum GamepadHotkey
HOTKEY_NEXT_PROFILE = 35;
HOTKEY_A3_BUTTON = 36;
HOTKEY_A4_BUTTON = 37;
HOTKEY_DPAD_UP = 38;
HOTKEY_DPAD_DOWN = 39;
HOTKEY_DPAD_LEFT = 40;
HOTKEY_DPAD_RIGHT = 41;
}

// This has to be kept in sync with LEDFormat in NeoPico.hpp
Expand All @@ -317,7 +321,7 @@ enum ShmupMixMode
enum PLEDType
{
option (nanopb_enumopt).long_names = false;

PLED_TYPE_NONE = -1;
PLED_TYPE_PWM = 0;
PLED_TYPE_RGB = 1;
Expand All @@ -326,7 +330,7 @@ enum PLEDType
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;
Expand All @@ -346,7 +350,7 @@ enum DualDirectionalCombinationMode
enum PS4ControllerType
{
option (nanopb_enumopt).long_names = false;

PS4_CONTROLLER = 0;
PS4_ARCADESTICK = 7;
}
Expand Down Expand Up @@ -378,7 +382,7 @@ enum GPElement
enum GPShape_Type
{
option (nanopb_enumopt).long_names = false;

GP_SHAPE_ELLIPSE = 0;
GP_SHAPE_SQUARE = 1;
GP_SHAPE_LINE = 2;
Expand Down
12 changes: 12 additions & 0 deletions src/gamepad.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,18 @@ void Gamepad::processHotkeyAction(GamepadHotkey action) {
case HOTKEY_A4_BUTTON:
state.buttons |= GAMEPAD_MASK_A4;
break;
case HOTKEY_DPAD_UP:
state.dpad |= GAMEPAD_MASK_UP;
break;
case HOTKEY_DPAD_DOWN:
state.dpad |= GAMEPAD_MASK_DOWN;
break;
case HOTKEY_DPAD_LEFT:
state.dpad |= GAMEPAD_MASK_LEFT;
break;
case HOTKEY_DPAD_RIGHT:
state.dpad |= GAMEPAD_MASK_RIGHT;
break;
case HOTKEY_SOCD_UP_PRIORITY:
if (action != lastAction) {
options.socdMode = SOCD_MODE_UP_PRIORITY;
Expand Down
4 changes: 4 additions & 0 deletions www/src/Locales/en/SettingsPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,10 @@ export default {
'a2-button': 'A2 Button',
'a3-button': 'A3 Button',
'a4-button': 'A4 Button',
'dpad-up': 'Dpad Up',
'dpad-down': 'Dpad Down',
'dpad-left': 'Dpad Left',
'dpad-right': 'Dpad Right',
'touchpad-button': 'Touchpad Button',
'load-profile-1': 'Load Profile #1',
'load-profile-2': 'Load Profile #2',
Expand Down
4 changes: 4 additions & 0 deletions www/src/Pages/SettingsPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,10 @@ const HOTKEY_ACTIONS = [
{ labelKey: 'hotkey-actions.a2-button', value: 34 },
{ labelKey: 'hotkey-actions.a3-button', value: 36 },
{ labelKey: 'hotkey-actions.a4-button', value: 37 },
{ labelKey: 'hotkey-actions.dpad-up', value: 38 },
{ labelKey: 'hotkey-actions.dpad-down', value: 39 },
{ labelKey: 'hotkey-actions.dpad-left', value: 40 },
{ labelKey: 'hotkey-actions.dpad-right', value: 41 },
];

const FORCED_SETUP_MODES = [
Expand Down