mirror of
https://github.com/Genymobile/scrcpy.git
synced 2025-08-02 22:29:25 +00:00
wip
This commit is contained in:
parent
c4648f1078
commit
7f781f1085
2 changed files with 14 additions and 5 deletions
|
@ -1,8 +1,8 @@
|
||||||
#include <input_events.h>
|
#include <input_events.h>
|
||||||
|
|
||||||
static inline enum sc_mod
|
static inline uint16_t
|
||||||
sc_mod_from_sdl(SDL_Keymod mod) {
|
sc_mod_from_sdl(uint16_t mod) {
|
||||||
return (enum sc_mod) mod;
|
return mod;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline enum sc_keycode
|
static inline enum sc_keycode
|
||||||
|
@ -40,7 +40,7 @@ sc_key_event_from_sdl(struct sc_key_event *event,
|
||||||
event->keycode = sc_keycode_from_sdl(sdl->keysym.sym);
|
event->keycode = sc_keycode_from_sdl(sdl->keysym.sym);
|
||||||
event->scancode = sc_scancode_from_sdl(sdl->keysym.scancode);
|
event->scancode = sc_scancode_from_sdl(sdl->keysym.scancode);
|
||||||
event->repeat = sdl->repeat;
|
event->repeat = sdl->repeat;
|
||||||
event->mods = sc_mod_from_sdl(sdl->keysym.mod);
|
event->mod = sc_mod_from_sdl(sdl->keysym.mod);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -282,11 +282,20 @@ enum sc_scancode {
|
||||||
SC_SCANCODE_RGUI = SDL_SCANCODE_RGUI,
|
SC_SCANCODE_RGUI = SDL_SCANCODE_RGUI,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static_assert(sizeof(enum sc_mod) >= sizeof(SDL_Keymod),
|
||||||
|
"SDL_Keymod must be convertible to sc_mod");
|
||||||
|
|
||||||
|
static_assert(sizeof(enum sc_keycode) >= sizeof(SDL_Keycode),
|
||||||
|
"SDL_Keycode must be convertible to sc_keycode");
|
||||||
|
|
||||||
|
static_assert(sizeof(enum sc_scancode) >= sizeof(SDL_Scancode),
|
||||||
|
"SDL_Scancode must be convertible to sc_scancode");
|
||||||
|
|
||||||
struct sc_key_event {
|
struct sc_key_event {
|
||||||
enum sc_action action;
|
enum sc_action action;
|
||||||
enum sc_keycode keycode;
|
enum sc_keycode keycode;
|
||||||
enum sc_scancode scancode;
|
enum sc_scancode scancode;
|
||||||
enum sc_mod mods; // bitwise-OR of sc_mod values
|
uint16_t mod; // bitwise-OR of sc_mod values
|
||||||
uint8_t repeat;
|
uint8_t repeat;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue