2021-10-03 23:11:20 +08:00
|
|
|
#ifndef SC_KEYBOARD_INJECT_H
|
|
|
|
#define SC_KEYBOARD_INJECT_H
|
|
|
|
|
|
|
|
#include "common.h"
|
|
|
|
|
|
|
|
#include <stdbool.h>
|
|
|
|
|
|
|
|
#include "controller.h"
|
2021-10-28 00:43:47 +08:00
|
|
|
#include "options.h"
|
2021-10-03 23:11:20 +08:00
|
|
|
#include "trait/key_processor.h"
|
|
|
|
|
|
|
|
struct sc_keyboard_inject {
|
|
|
|
struct sc_key_processor key_processor; // key processor trait
|
|
|
|
|
2022-01-15 05:17:30 +08:00
|
|
|
struct sc_controller *controller;
|
2021-10-03 23:11:20 +08:00
|
|
|
|
|
|
|
// SDL reports repeated events as a boolean, but Android expects the actual
|
|
|
|
// number of repetitions. This variable keeps track of the count.
|
|
|
|
unsigned repeat;
|
|
|
|
|
2021-11-27 05:05:28 +08:00
|
|
|
enum sc_key_inject_mode key_inject_mode;
|
2021-10-03 23:11:20 +08:00
|
|
|
bool forward_key_repeat;
|
|
|
|
};
|
|
|
|
|
|
|
|
void
|
|
|
|
sc_keyboard_inject_init(struct sc_keyboard_inject *ki,
|
2022-01-15 05:17:30 +08:00
|
|
|
struct sc_controller *controller,
|
2022-01-15 03:55:44 +08:00
|
|
|
enum sc_key_inject_mode key_inject_mode,
|
|
|
|
bool forward_key_repeat);
|
2021-10-03 23:11:20 +08:00
|
|
|
|
|
|
|
#endif
|