Use scrcpy input events for key processors

Pass scrcpy input events instead of SDL input events to key processors.

This makes the source code of key processors independent of the SDL API.
This commit is contained in:
Romain Vimont
2021-12-29 16:14:34 +01:00
parent 8aa92bdaa8
commit d2cdf2f507
4 changed files with 194 additions and 163 deletions

View File

@@ -6,7 +6,7 @@
#include <assert.h>
#include <stdbool.h>
#include <SDL2/SDL_events.h>
#include "input_events.h"
/**
* Key processor trait.
@@ -37,12 +37,12 @@ struct sc_key_processor_ops {
* Ctrl+v on the device.
*/
void
(*process_key)(struct sc_key_processor *kp, const SDL_KeyboardEvent *event,
uint64_t ack_to_wait);
(*process_key)(struct sc_key_processor *kp,
const struct sc_key_event *event, uint64_t ack_to_wait);
void
(*process_text)(struct sc_key_processor *kp,
const SDL_TextInputEvent *event);
const struct sc_text_event *event);
};
#endif