mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-02-05 07:30:27 +01:00
tablet: rename flags to mask
This is a simple button mask, use that naming. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Stephen Chandler Paul <thatslyude@gmail.com>
This commit is contained in:
parent
f86c89c5c8
commit
ee8fb790b0
1 changed files with 5 additions and 5 deletions
|
|
@ -152,14 +152,14 @@ tablet_update_button(struct tablet_dispatch *tablet,
|
|||
uint32_t evcode,
|
||||
uint32_t enable)
|
||||
{
|
||||
uint32_t button, *flags;
|
||||
uint32_t button, *mask;
|
||||
|
||||
/* XXX: This really depends on the expected buttons fitting in the mask */
|
||||
if (evcode >= BTN_MISC && evcode <= BTN_TASK) {
|
||||
flags = &tablet->button_state.pad_buttons;
|
||||
mask = &tablet->button_state.pad_buttons;
|
||||
button = evcode - BTN_MISC;
|
||||
} else if (evcode >= BTN_TOUCH && evcode <= BTN_STYLUS2) {
|
||||
flags = &tablet->button_state.stylus_buttons;
|
||||
mask = &tablet->button_state.stylus_buttons;
|
||||
button = evcode - BTN_TOUCH;
|
||||
} else {
|
||||
log_info("Unhandled button %s (%#x)\n",
|
||||
|
|
@ -170,10 +170,10 @@ tablet_update_button(struct tablet_dispatch *tablet,
|
|||
assert(button < 32);
|
||||
|
||||
if (enable) {
|
||||
(*flags) |= 1 << button;
|
||||
(*mask) |= 1 << button;
|
||||
tablet_set_status(tablet, TABLET_BUTTONS_PRESSED);
|
||||
} else {
|
||||
(*flags) &= ~(1 << button);
|
||||
(*mask) &= ~(1 << button);
|
||||
tablet_set_status(tablet, TABLET_BUTTONS_RELEASED);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue