Skip to content

Commit a44da7f

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 1034b45 commit a44da7f

File tree

7 files changed

+35
-1
lines changed

7 files changed

+35
-1
lines changed

configuration.c

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

22512251
#ifdef ANDROID
22522252
SETTING_BOOL("android_input_disconnect_workaround", &settings->bools.android_input_disconnect_workaround, true, false, false);
2253+
SETTING_BOOL("input_stylus_enable", &settings->bools.input_stylus_enable, true, true, false);
22532254
SETTING_BOOL("input_stylus_require_contact_for_click", &settings->bools.input_stylus_require_contact_for_click, true, true, false);
22542255
SETTING_BOOL("input_stylus_hover_moves_pointer", &settings->bools.input_stylus_hover_moves_pointer, true, false, false);
22552256
#endif

configuration.h

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

11161116
#ifdef ANDROID
11171117
bool android_input_disconnect_workaround;
1118+
bool input_stylus_enable;
11181119
bool input_stylus_require_contact_for_click;
11191120
bool input_stylus_hover_moves_pointer;
11201121
#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)
@@ -4756,6 +4757,9 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs,
47564757
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_input_touch_vmouse_gesture);
47574758
break;
47584759
#endif
4760+
case MENU_ENUM_LABEL_INPUT_STYLUS_ENABLE:
4761+
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_input_stylus_enable);
4762+
break;
47594763
case MENU_ENUM_LABEL_INPUT_STYLUS_REQUIRE_CONTACT_FOR_CLICK:
47604764
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_input_stylus_require_contact_for_click);
47614765
break;

menu/menu_displaylist.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8252,6 +8252,7 @@ unsigned menu_displaylist_build_list(
82528252
#endif
82538253
#ifdef ANDROID
82548254
{MENU_ENUM_LABEL_ANDROID_INPUT_DISCONNECT_WORKAROUND, PARSE_ONLY_BOOL, true},
8255+
{MENU_ENUM_LABEL_INPUT_STYLUS_ENABLE, PARSE_ONLY_BOOL, true},
82558256
{MENU_ENUM_LABEL_INPUT_STYLUS_REQUIRE_CONTACT_FOR_CLICK, PARSE_ONLY_BOOL, true},
82568257
{MENU_ENUM_LABEL_INPUT_STYLUS_HOVER_MOVES_POINTER, PARSE_ONLY_BOOL, true},
82578258
{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
@@ -15698,6 +15698,22 @@ static bool setting_append_list(
1569815698
SD_FLAG_NONE
1569915699
);
1570015700

15701+
CONFIG_BOOL(
15702+
list, list_info,
15703+
&settings->bools.input_stylus_enable,
15704+
MENU_ENUM_LABEL_INPUT_STYLUS_ENABLE,
15705+
MENU_ENUM_LABEL_VALUE_INPUT_STYLUS_ENABLE,
15706+
true,
15707+
MENU_ENUM_LABEL_VALUE_OFF,
15708+
MENU_ENUM_LABEL_VALUE_ON,
15709+
&group_info,
15710+
&subgroup_info,
15711+
parent_group,
15712+
general_write_handler,
15713+
general_read_handler,
15714+
SD_FLAG_NONE
15715+
);
15716+
1570115717
CONFIG_BOOL(
1570215718
list, list_info,
1570315719
&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
@@ -906,6 +906,7 @@ enum msg_hash_enums
906906
MENU_ENUM_LABEL_INPUT_DEVICE_RESERVED_DEVICE_NAME_LAST = MENU_ENUM_LABEL_INPUT_DEVICE_RESERVED_DEVICE_NAME + MAX_USERS,
907907
MENU_ENUM_LABEL_INPUT_MOUSE_INDEX,
908908
MENU_ENUM_LABEL_INPUT_MOUSE_INDEX_LAST = MENU_ENUM_LABEL_INPUT_MOUSE_INDEX + MAX_USERS,
909+
MENU_ENUM_LABEL_INPUT_STYLUS_ENABLE,
909910
MENU_ENUM_LABEL_INPUT_STYLUS_REQUIRE_CONTACT_FOR_CLICK,
910911
MENU_ENUM_LABEL_INPUT_STYLUS_HOVER_MOVES_POINTER,
911912
MENU_ENUM_LABEL_INPUT_REMAP_PORT,
@@ -1090,6 +1091,7 @@ enum msg_hash_enums
10901091
MENU_ENUM_LABEL_VALUE_INPUT_MOUSE_WHEEL_DOWN,
10911092
MENU_ENUM_LABEL_VALUE_INPUT_MOUSE_HORIZ_WHEEL_UP,
10921093
MENU_ENUM_LABEL_VALUE_INPUT_MOUSE_HORIZ_WHEEL_DOWN,
1094+
MENU_ENUM_LABEL_VALUE_INPUT_STYLUS_ENABLE,
10931095
MENU_ENUM_LABEL_VALUE_INPUT_STYLUS_REQUIRE_CONTACT_FOR_CLICK,
10941096
MENU_ENUM_LABEL_VALUE_INPUT_STYLUS_HOVER_MOVES_POINTER,
10951097
MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_LEFT_X,
@@ -1209,6 +1211,7 @@ enum msg_hash_enums
12091211
MENU_ENUM_SUBLABEL_INPUT_DEVICE_RESERVATION_TYPE,
12101212
MENU_ENUM_LABEL_HELP_INPUT_DEVICE_RESERVATION_TYPE,
12111213
MENU_ENUM_SUBLABEL_INPUT_MOUSE_INDEX,
1214+
MENU_ENUM_SUBLABEL_INPUT_STYLUS_ENABLE,
12121215
MENU_ENUM_SUBLABEL_INPUT_STYLUS_REQUIRE_CONTACT_FOR_CLICK,
12131216
MENU_ENUM_SUBLABEL_INPUT_STYLUS_HOVER_MOVES_POINTER,
12141217
MENU_ENUM_SUBLABEL_INPUT_ADC_TYPE,

0 commit comments

Comments
 (0)