From 9950c6147a626304eca25504a487a332ac7a9c22 Mon Sep 17 00:00:00 2001 From: whitesnakeftw Date: Wed, 4 Mar 2026 00:38:54 +0100 Subject: [PATCH] add INFO button support --- app/scrcpy.1 | 5 +++++ app/src/cli.c | 8 ++++++++ app/src/input_manager.c | 9 +++++++++ 3 files changed, 22 insertions(+) diff --git a/app/scrcpy.1 b/app/scrcpy.1 index d6940449..54c78182 100644 --- a/app/scrcpy.1 +++ b/app/scrcpy.1 @@ -322,6 +322,7 @@ Each character must be one of the following: - 'b': trigger shortcut BACK (or turn screen on if off) - 'h': trigger shortcut HOME - 's': trigger shortcut APP_SWITCH + - 'i': trigger shortcut INFO - 'n': trigger shortcut "expand notification panel" Default is 'bhsn:++++' for SDK mouse, and '++++:bhsn' for AOA and UHID. @@ -731,6 +732,10 @@ Click on BACK .B MOD+s Click on APP_SWITCH +.TP +.B MOD+i +Click on INFO + .TP .B MOD+m Click on MENU diff --git a/app/src/cli.c b/app/src/cli.c index b2e3e30a..8cc7bc6f 100644 --- a/app/src/cli.c +++ b/app/src/cli.c @@ -603,6 +603,7 @@ static const struct sc_option options[] = { " 'b': trigger shortcut BACK (or turn screen on if off)\n" " 'h': trigger shortcut HOME\n" " 's': trigger shortcut APP_SWITCH\n" + " 'i': trigger shortcut INFO\n" " 'n': trigger shortcut \"expand notification panel\"\n" "Default is 'bhsn:++++' for SDK mouse, and '++++:bhsn' for AOA " "and UHID.", @@ -1122,6 +1123,10 @@ static const struct sc_shortcut shortcuts[] = { .shortcuts = { "MOD+s", "4th-click" }, .text = "Click on APP_SWITCH", }, + { + .shortcuts = { "MOD+i" }, + .text = "Click on INFO", + }, { .shortcuts = { "MOD+m" }, .text = "Click on MENU", @@ -2297,6 +2302,9 @@ parse_mouse_binding(char c, enum sc_mouse_binding *b) { case 's': *b = SC_MOUSE_BINDING_APP_SWITCH; return true; + case 'i': + *b = SC_MOUSE_BINDING_INFO; + return true; case 'n': *b = SC_MOUSE_BINDING_EXPAND_NOTIFICATION_PANEL; return true; diff --git a/app/src/input_manager.c b/app/src/input_manager.c index 3e4dd0f3..30e2d327 100644 --- a/app/src/input_manager.c +++ b/app/src/input_manager.c @@ -83,6 +83,11 @@ action_app_switch(struct sc_input_manager *im, enum sc_action action) { send_keycode(im, AKEYCODE_APP_SWITCH, action, "APP_SWITCH"); } +static inline void +action_info(struct sc_input_manager *im, enum sc_action action) { + send_keycode(im, AKEYCODE_INFO, action, "INFO"); +} + static inline void action_power(struct sc_input_manager *im, enum sc_action action) { send_keycode(im, AKEYCODE_POWER, action, "POWER"); @@ -417,6 +422,10 @@ sc_input_manager_process_key(struct sc_input_manager *im, if (im->kp && !shift && !repeat && !paused) { action_app_switch(im, action); } + case SDLK_i: + if (im->kp && !shift && !repeat && !paused) { + action_info(im, action); + } return; case SDLK_m: if (im->kp && !shift && !repeat && !paused) {