Skip to content

Commit 4a47f69

Browse files
f4mrfauxclaude
andcommitted
menu/config: Add comprehensive S Pen settings system integration
Complete settings framework integration for S Pen stylus support: * Add three new boolean configuration options: - input_stylus_enable: Master enable/disable for all stylus features - input_stylus_require_contact_for_click: Two-mode interaction control - input_stylus_hover_moves_pointer: Cursor movement during hover * Full menu system integration: - Menu entries with proper categorization in Input settings - Internationalization support with descriptive labels - Context-sensitive help text and sublabels - Proper settings validation and display logic * Configuration persistence across sessions * Backward compatibility with existing configurations Enables user control over S Pen behavior: contact-based vs hover+button interaction modes, with granular control over cursor movement and feature enablement. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 510a1c8 commit 4a47f69

7 files changed

Lines changed: 35 additions & 1 deletion

File tree

configuration.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2254,6 +2254,7 @@ static struct config_bool_setting *populate_settings_bool(
22542254

22552255
#ifdef ANDROID
22562256
SETTING_BOOL("android_input_disconnect_workaround", &settings->bools.android_input_disconnect_workaround, true, false, false);
2257+
SETTING_BOOL("input_stylus_enable", &settings->bools.input_stylus_enable, true, true, false);
22572258
SETTING_BOOL("input_stylus_require_contact_for_click", &settings->bools.input_stylus_require_contact_for_click, true, true, false);
22582259
SETTING_BOOL("input_stylus_hover_moves_pointer", &settings->bools.input_stylus_hover_moves_pointer, true, false, false);
22592260
#endif

configuration.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1120,6 +1120,7 @@ typedef struct settings
11201120

11211121
#ifdef ANDROID
11221122
bool android_input_disconnect_workaround;
1123+
bool input_stylus_enable;
11231124
bool input_stylus_require_contact_for_click;
11241125
bool input_stylus_hover_moves_pointer;
11251126
#endif

intl/msg_hash_us.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3384,13 +3384,21 @@ MSG_HASH(
33843384
MENU_ENUM_SUBLABEL_ANDROID_INPUT_DISCONNECT_WORKAROUND,
33853385
"Workaround for controllers disconnecting and reconnecting. Prevents users from having the same controller twice."
33863386
)
3387+
MSG_HASH(
3388+
MENU_ENUM_LABEL_VALUE_INPUT_STYLUS_ENABLE,
3389+
"Stylus Support"
3390+
)
3391+
MSG_HASH(
3392+
MENU_ENUM_SUBLABEL_INPUT_STYLUS_ENABLE,
3393+
"Enable support for S Pen and other stylus input devices. When disabled, all stylus events are ignored."
3394+
)
33873395
MSG_HASH(
33883396
MENU_ENUM_LABEL_VALUE_INPUT_STYLUS_REQUIRE_CONTACT_FOR_CLICK,
33893397
"Stylus Requires Contact for Click"
33903398
)
33913399
MSG_HASH(
33923400
MENU_ENUM_SUBLABEL_INPUT_STYLUS_REQUIRE_CONTACT_FOR_CLICK,
3393-
"S Pen stylus must make contact with screen to register clicks. When disabled, side button also works."
3401+
"When ON: S Pen must touch screen to click. When OFF: S Pen can click by touching screen OR by hovering and pressing side button."
33943402
)
33953403
MSG_HASH(
33963404
MENU_ENUM_LABEL_VALUE_INPUT_STYLUS_HOVER_MOVES_POINTER,

menu/cbs/menu_cbs_sublabel.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -568,6 +568,7 @@ DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_input_touch_vmouse_touchpad, MENU_
568568
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_input_touch_vmouse_trackball, MENU_ENUM_SUBLABEL_INPUT_TOUCH_VMOUSE_TRACKBALL)
569569
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_input_touch_vmouse_gesture, MENU_ENUM_SUBLABEL_INPUT_TOUCH_VMOUSE_GESTURE)
570570
#endif
571+
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_input_stylus_enable, MENU_ENUM_SUBLABEL_INPUT_STYLUS_ENABLE)
571572
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_input_stylus_require_contact_for_click, MENU_ENUM_SUBLABEL_INPUT_STYLUS_REQUIRE_CONTACT_FOR_CLICK)
572573
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_input_stylus_hover_moves_pointer, MENU_ENUM_SUBLABEL_INPUT_STYLUS_HOVER_MOVES_POINTER)
573574
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_button_axis_threshold, MENU_ENUM_SUBLABEL_INPUT_BUTTON_AXIS_THRESHOLD)
@@ -4768,6 +4769,9 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs,
47684769
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_input_touch_vmouse_gesture);
47694770
break;
47704771
#endif
4772+
case MENU_ENUM_LABEL_INPUT_STYLUS_ENABLE:
4773+
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_input_stylus_enable);
4774+
break;
47714775
case MENU_ENUM_LABEL_INPUT_STYLUS_REQUIRE_CONTACT_FOR_CLICK:
47724776
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_input_stylus_require_contact_for_click);
47734777
break;

menu/menu_displaylist.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8308,6 +8308,7 @@ unsigned menu_displaylist_build_list(
83088308
#endif
83098309
#ifdef ANDROID
83108310
{MENU_ENUM_LABEL_ANDROID_INPUT_DISCONNECT_WORKAROUND, PARSE_ONLY_BOOL, true},
8311+
{MENU_ENUM_LABEL_INPUT_STYLUS_ENABLE, PARSE_ONLY_BOOL, true},
83118312
{MENU_ENUM_LABEL_INPUT_STYLUS_REQUIRE_CONTACT_FOR_CLICK, PARSE_ONLY_BOOL, true},
83128313
{MENU_ENUM_LABEL_INPUT_STYLUS_HOVER_MOVES_POINTER, PARSE_ONLY_BOOL, true},
83138314
{MENU_ENUM_LABEL_INPUT_BLOCK_TIMEOUT, PARSE_ONLY_UINT, true},

menu/menu_setting.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15728,6 +15728,22 @@ static bool setting_append_list(
1572815728
SD_FLAG_NONE
1572915729
);
1573015730

15731+
CONFIG_BOOL(
15732+
list, list_info,
15733+
&settings->bools.input_stylus_enable,
15734+
MENU_ENUM_LABEL_INPUT_STYLUS_ENABLE,
15735+
MENU_ENUM_LABEL_VALUE_INPUT_STYLUS_ENABLE,
15736+
true,
15737+
MENU_ENUM_LABEL_VALUE_OFF,
15738+
MENU_ENUM_LABEL_VALUE_ON,
15739+
&group_info,
15740+
&subgroup_info,
15741+
parent_group,
15742+
general_write_handler,
15743+
general_read_handler,
15744+
SD_FLAG_NONE
15745+
);
15746+
1573115747
CONFIG_BOOL(
1573215748
list, list_info,
1573315749
&settings->bools.input_stylus_require_contact_for_click,

msg_hash.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -904,6 +904,7 @@ enum msg_hash_enums
904904
MENU_ENUM_LABEL_INPUT_DEVICE_RESERVED_DEVICE_NAME_LAST = MENU_ENUM_LABEL_INPUT_DEVICE_RESERVED_DEVICE_NAME + MAX_USERS,
905905
MENU_ENUM_LABEL_INPUT_MOUSE_INDEX,
906906
MENU_ENUM_LABEL_INPUT_MOUSE_INDEX_LAST = MENU_ENUM_LABEL_INPUT_MOUSE_INDEX + MAX_USERS,
907+
MENU_ENUM_LABEL_INPUT_STYLUS_ENABLE,
907908
MENU_ENUM_LABEL_INPUT_STYLUS_REQUIRE_CONTACT_FOR_CLICK,
908909
MENU_ENUM_LABEL_INPUT_STYLUS_HOVER_MOVES_POINTER,
909910
MENU_ENUM_LABEL_INPUT_REMAP_PORT,
@@ -1088,6 +1089,7 @@ enum msg_hash_enums
10881089
MENU_ENUM_LABEL_VALUE_INPUT_MOUSE_WHEEL_DOWN,
10891090
MENU_ENUM_LABEL_VALUE_INPUT_MOUSE_HORIZ_WHEEL_UP,
10901091
MENU_ENUM_LABEL_VALUE_INPUT_MOUSE_HORIZ_WHEEL_DOWN,
1092+
MENU_ENUM_LABEL_VALUE_INPUT_STYLUS_ENABLE,
10911093
MENU_ENUM_LABEL_VALUE_INPUT_STYLUS_REQUIRE_CONTACT_FOR_CLICK,
10921094
MENU_ENUM_LABEL_VALUE_INPUT_STYLUS_HOVER_MOVES_POINTER,
10931095
MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_LEFT_X,
@@ -1207,6 +1209,7 @@ enum msg_hash_enums
12071209
MENU_ENUM_SUBLABEL_INPUT_DEVICE_RESERVATION_TYPE,
12081210
MENU_ENUM_LABEL_HELP_INPUT_DEVICE_RESERVATION_TYPE,
12091211
MENU_ENUM_SUBLABEL_INPUT_MOUSE_INDEX,
1212+
MENU_ENUM_SUBLABEL_INPUT_STYLUS_ENABLE,
12101213
MENU_ENUM_SUBLABEL_INPUT_STYLUS_REQUIRE_CONTACT_FOR_CLICK,
12111214
MENU_ENUM_SUBLABEL_INPUT_STYLUS_HOVER_MOVES_POINTER,
12121215
MENU_ENUM_SUBLABEL_INPUT_ADC_TYPE,

0 commit comments

Comments
 (0)