Simplify (and inline) is_shortcut_mod()
Masking was unnecessary (im->sdl_shortcut_mods is implicitly masked). PR #5322 <https://github.com/Genymobile/scrcpy/pull/5322>
This commit is contained in:
parent
a6f74d72f5
commit
65fc53eace
@ -33,10 +33,10 @@ to_sdl_mod(uint8_t shortcut_mod) {
|
|||||||
return sdl_mod;
|
return sdl_mod;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool
|
static inline bool
|
||||||
is_shortcut_mod(struct sc_input_manager *im, uint16_t sdl_mod) {
|
is_shortcut_mod(struct sc_input_manager *im, uint16_t sdl_mod) {
|
||||||
// keep only the relevant modifier keys
|
// im->sdl_shortcut_mods is within the mask
|
||||||
sdl_mod &= SC_SDL_SHORTCUT_MODS_MASK;
|
assert(!(im->sdl_shortcut_mods & ~SC_SDL_SHORTCUT_MODS_MASK));
|
||||||
|
|
||||||
// at least one shortcut mod pressed?
|
// at least one shortcut mod pressed?
|
||||||
return sdl_mod & im->sdl_shortcut_mods;
|
return sdl_mod & im->sdl_shortcut_mods;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user