Skip to content

Commit

Permalink
Add new mouse button mappings:
Browse files Browse the repository at this point in the history
- Map mouse button SDL_BUTTON_X1 to back
- Map mouse button 7 for switching apps
  • Loading branch information
AlexBurdu authored and Alex committed Mar 22, 2022
1 parent adbe790 commit 2334add
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions app/src/input_manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -632,23 +632,23 @@ sc_input_manager_process_mouse_button(struct sc_input_manager *im,
if (controller) {
enum sc_action action = down ? SC_ACTION_DOWN : SC_ACTION_UP;

if (event->button == SDL_BUTTON_X1) {
if (control && event->button == 7) {
action_app_switch(controller, action);
return;
}
if (event->button == SDL_BUTTON_X2 && down) {
if (control && event->button == SDL_BUTTON_X2 && down) {
if (event->clicks < 2) {
expand_notification_panel(controller);
} else {
expand_settings_panel(controller);
}
return;
}
if (event->button == SDL_BUTTON_RIGHT) {
if (control && (event->button == SDL_BUTTON_RIGHT || event->button == SDL_BUTTON_X1)) {
press_back_or_turn_screen_on(controller, action);
return;
}
if (event->button == SDL_BUTTON_MIDDLE) {
if (control && event->button == SDL_BUTTON_MIDDLE) {
action_home(controller, action);
return;
}
Expand Down

0 comments on commit 2334add

Please sign in to comment.