labwc/include/input/keyboard.h
Simon Long 84c222a84f Add onRelease option to <keybind>
...to make keybind actions fire on the release event rather then when the
key is first pressed. This is useful for binding actions to modifier keys
only. The most likely use-case for this is the binding of a Super key to a
menu, for example:

    <keybind key="Super_L" onRelease="yes">
      <action name="Execute" command="rofi -show drun"/>
    </keybind>

If another keybind is issued between the press and release, the on-release
keybind is cancelled.

Co-authored-by: @johanmalm
2024-06-09 21:15:58 +01:00

25 lines
779 B
C

/* SPDX-License-Identifier: GPL-2.0-only */
#ifndef LABWC_KEYBOARD_H
#define LABWC_KEYBOARD_H
#include <stdbool.h>
#include <xkbcommon/xkbcommon.h>
struct seat;
struct keyboard;
struct wlr_keyboard;
void keyboard_reset_current_keybind(void);
void keyboard_configure(struct seat *seat, struct wlr_keyboard *kb,
bool is_virtual);
void keyboard_group_init(struct seat *seat);
void keyboard_group_finish(struct seat *seat);
void keyboard_setup_handlers(struct keyboard *keyboard);
void keyboard_set_numlock(struct wlr_keyboard *keyboard);
void keyboard_update_layout(struct seat *seat, xkb_layout_index_t layout);
void keyboard_cancel_keybind_repeat(struct keyboard *keyboard);
bool keyboard_any_modifiers_pressed(struct wlr_keyboard *keyboard);
#endif /* LABWC_KEYBOARD_H */