Compare commits
2 Commits
master
...
macos_volu
Author | SHA1 | Date | |
---|---|---|---|
|
fbdcc42dbb | ||
|
aa10721c9e |
@ -134,8 +134,8 @@ scrcpy -f
|
|||||||
| click on `BACK` | `Ctrl`+`b` \| _Right-click²_ |
|
| click on `BACK` | `Ctrl`+`b` \| _Right-click²_ |
|
||||||
| click on `APP_SWITCH` | `Ctrl`+`s` |
|
| click on `APP_SWITCH` | `Ctrl`+`s` |
|
||||||
| click on `MENU` | `Ctrl`+`m` |
|
| click on `MENU` | `Ctrl`+`m` |
|
||||||
| click on `VOLUME_UP` | `Ctrl`+`↑` _(up)_ |
|
| click on `VOLUME_UP` | `Ctrl`+`↑` _(up)_ (`Cmd`+`↑` on MacOS) |
|
||||||
| click on `VOLUME_DOWN` | `Ctrl`+`↓` _(down)_ |
|
| click on `VOLUME_DOWN` | `Ctrl`+`↓` _(down)_ (`Cmd`+`↓` on MacOS) |
|
||||||
| click on `POWER` | `Ctrl`+`p` |
|
| click on `POWER` | `Ctrl`+`p` |
|
||||||
| turn screen on | _Right-click²_ |
|
| turn screen on | _Right-click²_ |
|
||||||
| paste computer clipboard to device | `Ctrl`+`v` |
|
| paste computer clipboard to device | `Ctrl`+`v` |
|
||||||
|
@ -154,14 +154,14 @@ void input_manager_process_key(struct input_manager *input_manager,
|
|||||||
SDL_bool alt = event->keysym.mod & (KMOD_LALT | KMOD_RALT);
|
SDL_bool alt = event->keysym.mod & (KMOD_LALT | KMOD_RALT);
|
||||||
SDL_bool meta = event->keysym.mod & (KMOD_LGUI | KMOD_RGUI);
|
SDL_bool meta = event->keysym.mod & (KMOD_LGUI | KMOD_RGUI);
|
||||||
|
|
||||||
if (alt | meta) {
|
if (alt) {
|
||||||
// no shortcut involves Alt or Meta, and they should not be forwarded
|
// no shortcut involves Alt or Meta, and they should not be forwarded
|
||||||
// to the device
|
// to the device
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// capture all Ctrl events
|
// capture all Ctrl events
|
||||||
if (ctrl) {
|
if (ctrl | meta) {
|
||||||
SDL_bool shift = event->keysym.mod & (KMOD_LSHIFT | KMOD_RSHIFT);
|
SDL_bool shift = event->keysym.mod & (KMOD_LSHIFT | KMOD_RSHIFT);
|
||||||
if (shift) {
|
if (shift) {
|
||||||
// currently, there is no shortcut involving SHIFT
|
// currently, there is no shortcut involving SHIFT
|
||||||
@ -173,61 +173,73 @@ void input_manager_process_key(struct input_manager *input_manager,
|
|||||||
SDL_bool repeat = event->repeat;
|
SDL_bool repeat = event->repeat;
|
||||||
switch (keycode) {
|
switch (keycode) {
|
||||||
case SDLK_h:
|
case SDLK_h:
|
||||||
if (!repeat) {
|
if (ctrl && !meta && !repeat) {
|
||||||
action_home(input_manager->controller, action);
|
action_home(input_manager->controller, action);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
case SDLK_b: // fall-through
|
case SDLK_b: // fall-through
|
||||||
case SDLK_BACKSPACE:
|
case SDLK_BACKSPACE:
|
||||||
if (!repeat) {
|
if (ctrl && !meta && !repeat) {
|
||||||
action_back(input_manager->controller, action);
|
action_back(input_manager->controller, action);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
case SDLK_s:
|
case SDLK_s:
|
||||||
if (!repeat) {
|
if (ctrl && !meta && !repeat) {
|
||||||
action_app_switch(input_manager->controller, action);
|
action_app_switch(input_manager->controller, action);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
case SDLK_m:
|
case SDLK_m:
|
||||||
if (!repeat) {
|
if (ctrl && !meta && !repeat) {
|
||||||
action_menu(input_manager->controller, action);
|
action_menu(input_manager->controller, action);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
case SDLK_p:
|
case SDLK_p:
|
||||||
if (!repeat) {
|
if (ctrl && !meta && !repeat) {
|
||||||
action_power(input_manager->controller, action);
|
action_power(input_manager->controller, action);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
case SDLK_DOWN:
|
case SDLK_DOWN:
|
||||||
// forward repeated events
|
#ifdef __APPLE__
|
||||||
action_volume_down(input_manager->controller, action);
|
if (!ctrl && meta) {
|
||||||
|
#else
|
||||||
|
if (ctrl && !meta) {
|
||||||
|
#endif
|
||||||
|
// forward repeated events
|
||||||
|
action_volume_down(input_manager->controller, action);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
case SDLK_UP:
|
case SDLK_UP:
|
||||||
// forward repeated events
|
#ifdef __APPLE__
|
||||||
action_volume_up(input_manager->controller, action);
|
if (!ctrl && meta) {
|
||||||
|
#else
|
||||||
|
if (ctrl && !meta) {
|
||||||
|
#endif
|
||||||
|
// forward repeated events
|
||||||
|
action_volume_up(input_manager->controller, action);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
case SDLK_v:
|
case SDLK_v:
|
||||||
if (!repeat && event->type == SDL_KEYDOWN) {
|
if (ctrl && !meta && !repeat && event->type == SDL_KEYDOWN) {
|
||||||
clipboard_paste(input_manager->controller);
|
clipboard_paste(input_manager->controller);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
case SDLK_f:
|
case SDLK_f:
|
||||||
if (!repeat && event->type == SDL_KEYDOWN) {
|
if (ctrl && !meta && !repeat && event->type == SDL_KEYDOWN) {
|
||||||
screen_switch_fullscreen(input_manager->screen);
|
screen_switch_fullscreen(input_manager->screen);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
case SDLK_x:
|
case SDLK_x:
|
||||||
if (!repeat && event->type == SDL_KEYDOWN) {
|
if (ctrl && !meta && !repeat && event->type == SDL_KEYDOWN) {
|
||||||
screen_resize_to_fit(input_manager->screen);
|
screen_resize_to_fit(input_manager->screen);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
case SDLK_g:
|
case SDLK_g:
|
||||||
if (!repeat && event->type == SDL_KEYDOWN) {
|
if (ctrl && !meta && !repeat && event->type == SDL_KEYDOWN) {
|
||||||
screen_resize_to_pixel_perfect(input_manager->screen);
|
screen_resize_to_pixel_perfect(input_manager->screen);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
case SDLK_i:
|
case SDLK_i:
|
||||||
if (!repeat && event->type == SDL_KEYDOWN) {
|
if (ctrl && !meta && !repeat && event->type == SDL_KEYDOWN) {
|
||||||
switch_fps_counter_state(input_manager->frames);
|
switch_fps_counter_state(input_manager->frames);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user