mirror of
https://github.com/labwc/labwc.git
synced 2025-11-04 13:30:07 -05:00
Revert "keyboard: cancel repeat when handling key-bind"
This reverts commit e62bb51bfb.
Fixes #510
This commit is contained in:
parent
87fe6878a3
commit
a363f73e02
3 changed files with 3 additions and 12 deletions
|
|
@ -5,8 +5,6 @@
|
||||||
void key_state_set_pressed(uint32_t keycode, bool ispressed);
|
void key_state_set_pressed(uint32_t keycode, bool ispressed);
|
||||||
void key_state_store_pressed_keys_as_bound(void);
|
void key_state_store_pressed_keys_as_bound(void);
|
||||||
bool key_state_corresponding_press_event_was_bound(uint32_t keycode);
|
bool key_state_corresponding_press_event_was_bound(uint32_t keycode);
|
||||||
|
void key_state_bound_key_remove(uint32_t keycode);
|
||||||
/* returns numbers of keys still pressed in a consumed key combination */
|
|
||||||
int key_state_bound_key_remove(uint32_t keycode);
|
|
||||||
|
|
||||||
#endif /* __LABWC_KEY_STATE_H */
|
#endif /* __LABWC_KEY_STATE_H */
|
||||||
|
|
|
||||||
|
|
@ -63,9 +63,8 @@ key_state_corresponding_press_event_was_bound(uint32_t keycode)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
void
|
||||||
key_state_bound_key_remove(uint32_t keycode)
|
key_state_bound_key_remove(uint32_t keycode)
|
||||||
{
|
{
|
||||||
remove_key(&bound, keycode);
|
remove_key(&bound, keycode);
|
||||||
return bound.nr_keys;
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -67,14 +67,12 @@ static bool
|
||||||
handle_keybinding(struct server *server, uint32_t modifiers, xkb_keysym_t sym)
|
handle_keybinding(struct server *server, uint32_t modifiers, xkb_keysym_t sym)
|
||||||
{
|
{
|
||||||
struct keybind *keybind;
|
struct keybind *keybind;
|
||||||
struct wlr_keyboard *kb = &server->seat.keyboard_group->keyboard;
|
|
||||||
wl_list_for_each_reverse (keybind, &rc.keybinds, link) {
|
wl_list_for_each_reverse (keybind, &rc.keybinds, link) {
|
||||||
if (modifiers ^ keybind->modifiers) {
|
if (modifiers ^ keybind->modifiers) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
for (size_t i = 0; i < keybind->keysyms_len; i++) {
|
for (size_t i = 0; i < keybind->keysyms_len; i++) {
|
||||||
if (xkb_keysym_to_lower(sym) == keybind->keysyms[i]) {
|
if (xkb_keysym_to_lower(sym) == keybind->keysyms[i]) {
|
||||||
wlr_keyboard_set_repeat_info(kb, 0, 0);
|
|
||||||
actions_run(NULL, server, &keybind->actions, 0);
|
actions_run(NULL, server, &keybind->actions, 0);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
@ -120,11 +118,7 @@ handle_compositor_keybindings(struct wl_listener *listener,
|
||||||
*/
|
*/
|
||||||
if (key_state_corresponding_press_event_was_bound(keycode)
|
if (key_state_corresponding_press_event_was_bound(keycode)
|
||||||
&& event->state == WL_KEYBOARD_KEY_STATE_RELEASED) {
|
&& event->state == WL_KEYBOARD_KEY_STATE_RELEASED) {
|
||||||
int nr_bound_keys = key_state_bound_key_remove(keycode);
|
key_state_bound_key_remove(keycode);
|
||||||
if (!nr_bound_keys) {
|
|
||||||
wlr_keyboard_set_repeat_info(keyboard,
|
|
||||||
rc.repeat_rate, rc.repeat_delay);
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue