notify_key(&c->base.seat->seat, time, key,
state ? WL_KEYBOARD_KEY_STATE_PRESSED :
- WL_KEYBOARD_KEY_STATE_RELEASED);
+ WL_KEYBOARD_KEY_STATE_RELEASED,
+ STATE_UPDATE_AUTOMATIC);
}
static void
notify_key(&c->base.seat->seat,
weston_compositor_get_time(),
key_release->detail - 8,
- WL_KEYBOARD_KEY_STATE_RELEASED);
+ WL_KEYBOARD_KEY_STATE_RELEASED,
+ STATE_UPDATE_AUTOMATIC);
free(prev);
prev = NULL;
break;
notify_key(&c->base.seat->seat,
weston_compositor_get_time(),
key_press->detail - 8,
- WL_KEYBOARD_KEY_STATE_PRESSED);
+ WL_KEYBOARD_KEY_STATE_PRESSED,
+ STATE_UPDATE_AUTOMATIC);
break;
case XCB_KEY_RELEASE:
/* If we don't have XKB, we need to use the lame
notify_key(&c->base.seat->seat,
weston_compositor_get_time(),
key_release->detail - 8,
- WL_KEYBOARD_KEY_STATE_RELEASED);
+ WL_KEYBOARD_KEY_STATE_RELEASED,
+ STATE_UPDATE_AUTOMATIC);
break;
case XCB_BUTTON_PRESS:
x11_compositor_deliver_button_event(c, event, 1);
notify_key(&c->base.seat->seat,
weston_compositor_get_time(),
key_release->detail - 8,
- WL_KEYBOARD_KEY_STATE_RELEASED);
+ WL_KEYBOARD_KEY_STATE_RELEASED,
+ STATE_UPDATE_AUTOMATIC);
free(prev);
prev = NULL;
break;
WL_EXPORT void
notify_key(struct wl_seat *seat, uint32_t time, uint32_t key,
- enum wl_keyboard_key_state state)
+ enum wl_keyboard_key_state state,
+ enum weston_key_state_update update_state)
{
struct weston_seat *ws = (struct weston_seat *) seat;
struct weston_compositor *compositor = ws->compositor;
struct wl_keyboard_grab *grab = seat->keyboard->grab;
uint32_t serial = wl_display_next_serial(compositor->wl_display);
uint32_t *k, *end;
- int mods;
+ int mods = 0;
if (state == WL_KEYBOARD_KEY_STATE_PRESSED) {
if (compositor->ping_handler && focus)
weston_compositor_idle_release(compositor);
}
- mods = update_modifier_state(ws, key, state);
+ if (update_state == STATE_UPDATE_AUTOMATIC)
+ mods = update_modifier_state(ws, key, state);
end = seat->keyboard->keys.data + seat->keyboard->keys.size;
for (k = seat->keyboard->keys.data; k < end; k++) {
if (*k == key) {
wl_fixed_t value);
void
notify_key(struct wl_seat *seat, uint32_t time, uint32_t key,
- enum wl_keyboard_key_state state);
+ enum wl_keyboard_key_state state,
+ enum weston_key_state_update update_state);
void
notify_pointer_focus(struct wl_seat *seat, struct weston_output *output,
notify_key(&device->master->base.seat,
time, e->code,
e->value ? WL_KEYBOARD_KEY_STATE_PRESSED :
- WL_KEYBOARD_KEY_STATE_RELEASED);
+ WL_KEYBOARD_KEY_STATE_RELEASED,
+ STATE_UPDATE_AUTOMATIC);
break;
}
}