Turn screen on on right-click

The right-click is almost useless on Android, so use it to turn the
screen on.

Add a new control event type (command) to request the server to turn the
screen on.
This commit is contained in:
Romain Vimont
2018-02-02 14:52:23 +01:00
parent 228545cefd
commit a139509f11
9 changed files with 107 additions and 1 deletions

View File

@@ -52,6 +52,9 @@ int control_event_serialize(const struct control_event *event, unsigned char *bu
write32(&buf[9], (Uint32) event->scroll_event.hscroll);
write32(&buf[13], (Uint32) event->scroll_event.vscroll);
return 17;
case CONTROL_EVENT_TYPE_COMMAND:
buf[1] = event->command_event.action;
return 2;
default:
SDL_LogWarn(SDL_LOG_CATEGORY_APPLICATION, "Unknown event type: %u", (unsigned) event->type);
return 0;