This commit is contained in:
whitesnakeftw 2026-04-20 10:48:38 +00:00 committed by GitHub
commit 1ae45e76e2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 37 additions and 6 deletions

View file

@ -323,6 +323,7 @@ Each character must be one of the following:
- 'h': trigger shortcut HOME
- 's': trigger shortcut APP_SWITCH
- 'n': trigger shortcut "expand notification panel"
- 'i': trigger shortcut INFO
Default is 'bhsn:++++' for SDK mouse, and '++++:bhsn' for AOA and UHID.
@ -747,6 +748,10 @@ Click on VOLUME_DOWN
.B MOD+p
Click on POWER (turn screen on/off)
.TP
.B MOD+i
Click on INFO
.TP
.B Right\-click (when screen is off)
Turn screen on
@ -792,7 +797,7 @@ Inject computer clipboard text as a sequence of key events
Open keyboard settings on the device (for HID keyboard only)
.TP
.B MOD+i
.B MOD+q
Enable/disable FPS counter (print frames/second in logs)
.TP

View file

@ -604,6 +604,7 @@ static const struct sc_option options[] = {
" 'h': trigger shortcut HOME\n"
" 's': trigger shortcut APP_SWITCH\n"
" 'n': trigger shortcut \"expand notification panel\"\n"
" 'i': trigger shortcut INFO\n"
"Default is 'bhsn:++++' for SDK mouse, and '++++:bhsn' for AOA "
"and UHID.",
},
@ -785,7 +786,7 @@ static const struct sc_option options[] = {
.longopt_id = OPT_PRINT_FPS,
.longopt = "print-fps",
.text = "Start FPS counter, to print framerate logs to the console. "
"It can be started or stopped at any time with MOD+i.",
"It can be started or stopped at any time with MOD+q.",
},
{
.longopt_id = OPT_PUSH_TARGET,
@ -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",
@ -1184,7 +1189,7 @@ static const struct sc_shortcut shortcuts[] = {
.text = "Open keyboard settings on the device (for HID keyboard only)",
},
{
.shortcuts = { "MOD+i" },
.shortcuts = { "MOD+q" },
.text = "Enable/disable FPS counter (print frames/second in logs)",
},
{
@ -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;
@ -2333,7 +2341,7 @@ parse_mouse_bindings(const char *s, struct sc_mouse_bindings *mb) {
// either "xxxx" or "xxxx:xxxx"
if (len != 4 && (len != 9 || s[4] != ':')) {
LOGE("Invalid mouse bindings: '%s' (expected 'xxxx' or 'xxxx:xxxx', "
"with each 'x' being in {'+', '-', 'b', 'h', 's', 'n'})", s);
"with each 'x' being in {'+', '-', 'b', 'h', 's', 'n', 'i'})", s);
return false;
}

View file

@ -103,6 +103,11 @@ action_menu(struct sc_input_manager *im, enum sc_action action) {
send_keycode(im, AKEYCODE_MENU, action, "MENU");
}
static inline void
action_info(struct sc_input_manager *im, enum sc_action action) {
send_keycode(im, AKEYCODE_INFO, action, "INFO");
}
// turn the screen on if it was off, press BACK otherwise
// If the screen is off, it is turned on only on ACTION_DOWN
static void
@ -428,6 +433,11 @@ sc_input_manager_process_key(struct sc_input_manager *im,
action_power(im, action);
}
return;
case SDLK_i:
if (im->kp && !shift && !repeat && !paused) {
action_info(im, action);
}
return;
case SDLK_o:
if (control && !repeat && down && !paused) {
bool on = shift;
@ -520,7 +530,7 @@ sc_input_manager_process_key(struct sc_input_manager *im,
sc_screen_resize_to_pixel_perfect(im->screen);
}
return;
case SDLK_i:
case SDLK_q:
if (video && !shift && !repeat && down) {
switch_fps_counter_state(im);
}
@ -776,6 +786,11 @@ sc_input_manager_process_mouse_button(struct sc_input_manager *im,
}
}
return;
case SC_MOUSE_BINDING_INFO:
if (im->kp) {
action_info(im, action);
}
return;
default:
assert(binding == SC_MOUSE_BINDING_CLICK);
break;

View file

@ -183,6 +183,7 @@ enum sc_mouse_binding {
SC_MOUSE_BINDING_HOME,
SC_MOUSE_BINDING_APP_SWITCH,
SC_MOUSE_BINDING_EXPAND_NOTIFICATION_PANEL,
SC_MOUSE_BINDING_INFO,
};
struct sc_mouse_binding_set {

View file

@ -125,6 +125,7 @@ Each character must be one of the following:
- `h`: trigger shortcut `HOME`
- `s`: trigger shortcut `APP_SWITCH`
- `n`: trigger shortcut "expand notification panel"
- `i`: trigger shortcut `INFO`
For example:

View file

@ -40,6 +40,7 @@ _<kbd>[Super]</kbd> is typically the <kbd>Windows</kbd> or <kbd>Cmd</kbd> key._
| Click on `VOLUME_UP` | <kbd>MOD</kbd>+<kbd></kbd> _(up)_
| Click on `VOLUME_DOWN` | <kbd>MOD</kbd>+<kbd></kbd> _(down)_
| Click on `POWER` | <kbd>MOD</kbd>+<kbd>p</kbd>
| Click on `INFO` | <kbd>MOD</kbd>+<kbd>i</kbd>
| Power on | _Right-click²_
| Turn device screen off (keep mirroring) | <kbd>MOD</kbd>+<kbd>o</kbd>
| Turn device screen on | <kbd>MOD</kbd>+<kbd>Shift</kbd>+<kbd>o</kbd>
@ -52,7 +53,7 @@ _<kbd>[Super]</kbd> is typically the <kbd>Windows</kbd> or <kbd>Cmd</kbd> key._
| Synchronize clipboards and paste⁵ | <kbd>MOD</kbd>+<kbd>v</kbd>
| Inject computer clipboard text | <kbd>MOD</kbd>+<kbd>Shift</kbd>+<kbd>v</kbd>
| Open keyboard settings (HID keyboard only) | <kbd>MOD</kbd>+<kbd>k</kbd>
| Enable/disable FPS counter (on stdout) | <kbd>MOD</kbd>+<kbd>i</kbd>
| Enable/disable FPS counter (on stdout) | <kbd>MOD</kbd>+<kbd>q</kbd>
| Pinch-to-zoom/rotate | <kbd>Ctrl</kbd>+_click-and-move_
| Tilt vertically (slide with 2 fingers) | <kbd>Shift</kbd>+_click-and-move_
| Tilt horizontally (slide with 2 fingers) | <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+_click-and-move_