Add support for CTRL+S to send hardware "shake" to device w/readme

This commit is contained in:
Andy Rich 2018-03-20 18:04:40 -07:00
parent f5cf6c1b2c
commit 301c52b603
3 changed files with 11 additions and 0 deletions

View file

@ -258,6 +258,7 @@ To run without installing:
| 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`+`m` |
| click on `MENU` | `Ctrl`+`s` |
| 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_shake(struct controller *controller) {
send_keycode(controller, AKEYCODE_MENU, "SHAKE");
}
// 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;
@ -179,6 +183,9 @@ void input_manager_process_key(struct input_manager *input_manager,
case SDLK_m: case SDLK_m:
action_app_switch(input_manager->controller); action_app_switch(input_manager->controller);
return; return;
case SDLK_s:
action_shake(input_manager->controller);
return;
case SDLK_p: case SDLK_p:
action_power(input_manager->controller); action_power(input_manager->controller);
return; return;

View file

@ -73,6 +73,9 @@ static void usage(const char *arg0) {
" Ctrl+m\n" " Ctrl+m\n"
" click on APP_SWITCH\n" " click on APP_SWITCH\n"
"\n" "\n"
" Ctrl+s\n"
" click on MENU\n"
"\n"
" Ctrl+'+'\n" " Ctrl+'+'\n"
" click on VOLUME_UP\n" " click on VOLUME_UP\n"
"\n" "\n"