Extract keyboard processor trait

This will allow to provide alternative key processors.
This commit is contained in:
Romain Vimont 2021-10-03 17:11:20 +02:00
commit bcf5a9750f
9 changed files with 335 additions and 227 deletions

View file

@ -11,18 +11,15 @@
#include "fps_counter.h"
#include "scrcpy.h"
#include "screen.h"
#include "trait/key_processor.h"
struct input_manager {
struct controller *controller;
struct screen *screen;
// SDL reports repeated events as a boolean, but Android expects the actual
// number of repetitions. This variable keeps track of the count.
unsigned repeat;
struct sc_key_processor *kp;
bool control;
bool forward_key_repeat;
bool prefer_text;
bool forward_all_clicks;
bool legacy_paste;
@ -43,7 +40,8 @@ struct input_manager {
void
input_manager_init(struct input_manager *im, struct controller *controller,
struct screen *screen, const struct scrcpy_options *options);
struct screen *screen, struct sc_key_processor *kp,
const struct scrcpy_options *options);
bool
input_manager_handle_event(struct input_manager *im, SDL_Event *event);