Merge branch 'arich/addShake' into dev (#85)

Add support for CTRL+S to send hardware "shake" to device
This commit is contained in:
Romain Vimont 2018-03-23 10:13:19 +01:00
commit 29b5c5b8f4
3 changed files with 14 additions and 3 deletions

View file

@ -257,7 +257,8 @@ To run without installing:
| resize window to remove black borders | `Ctrl`+`x` \| _Double-click¹_ | | resize window to remove black borders | `Ctrl`+`x` \| _Double-click¹_ |
| click on `HOME` | `Ctrl`+`h` \| _Middle-click_ | | click on `HOME` | `Ctrl`+`h` \| _Middle-click_ |
| click on `BACK` | `Ctrl`+`b` \| _Right-click²_ | | click on `BACK` | `Ctrl`+`b` \| _Right-click²_ |
| click on `APP_SWITCH` | `Ctrl`+`m` | | click on `APP_SWITCH` | `Ctrl`+`s` |
| click on `MENU` | `Ctrl`+`m` |
| click on `VOLUME_UP` | `Ctrl`+`+` | | click on `VOLUME_UP` | `Ctrl`+`+` |
| click on `VOLUME_DOWN` | `Ctrl`+`-` | | click on `VOLUME_DOWN` | `Ctrl`+`-` |
| click on `POWER` | `Ctrl`+`p` | | click on `POWER` | `Ctrl`+`p` |

View file

@ -78,6 +78,10 @@ static inline void action_volume_down(struct controller *controller) {
send_keycode(controller, AKEYCODE_VOLUME_DOWN, "VOLUME_DOWN"); send_keycode(controller, AKEYCODE_VOLUME_DOWN, "VOLUME_DOWN");
} }
static inline void action_menu(struct controller *controller) {
send_keycode(controller, AKEYCODE_MENU, "MENU");
}
// turn the screen on if it was off, press BACK otherwise // turn the screen on if it was off, press BACK otherwise
static void press_back_or_turn_screen_on(struct controller *controller) { static void press_back_or_turn_screen_on(struct controller *controller) {
struct control_event control_event; struct control_event control_event;
@ -176,9 +180,12 @@ void input_manager_process_key(struct input_manager *input_manager,
case SDLK_BACKSPACE: case SDLK_BACKSPACE:
action_back(input_manager->controller); action_back(input_manager->controller);
return; return;
case SDLK_m: case SDLK_s:
action_app_switch(input_manager->controller); action_app_switch(input_manager->controller);
return; return;
case SDLK_m:
action_menu(input_manager->controller);
return;
case SDLK_p: case SDLK_p:
action_power(input_manager->controller); action_power(input_manager->controller);
return; return;

View file

@ -70,9 +70,12 @@ static void usage(const char *arg0) {
" Right-click (when screen is on)\n" " Right-click (when screen is on)\n"
" click on BACK\n" " click on BACK\n"
"\n" "\n"
" Ctrl+m\n" " Ctrl+s\n"
" click on APP_SWITCH\n" " click on APP_SWITCH\n"
"\n" "\n"
" Ctrl+m\n"
" click on MENU\n"
"\n"
" Ctrl+'+'\n" " Ctrl+'+'\n"
" click on VOLUME_UP\n" " click on VOLUME_UP\n"
"\n" "\n"