labwc/include/config/keybind.h

43 lines
1 KiB
C
Raw Permalink Normal View History

2021-11-13 21:56:53 +00:00
/* SPDX-License-Identifier: GPL-2.0-only */
#ifndef LABWC_KEYBIND_H
#define LABWC_KEYBIND_H
2020-08-03 20:56:38 +01:00
#include <wlr/types/wlr_keyboard.h>
#include <xkbcommon/xkbcommon.h>
#define MAX_KEYSYMS 32
#define MAX_KEYCODES 16
struct server;
2020-08-03 20:56:38 +01:00
struct keybind {
uint32_t modifiers;
xkb_keysym_t *keysyms;
size_t keysyms_len;
bool use_syms_only;
xkb_keycode_t keycodes[MAX_KEYCODES];
size_t keycodes_len;
int keycodes_layout;
struct wl_list actions; /* struct action.link */
struct wl_list link; /* struct rcxml.keybinds */
bool on_release;
2020-08-03 20:56:38 +01:00
};
2020-08-07 20:21:14 +01:00
/**
2020-09-02 21:05:28 +01:00
* keybind_create - parse keybind and add to linked list
2020-08-07 20:21:14 +01:00
* @keybind: key combination
*/
2020-09-02 21:05:28 +01:00
struct keybind *keybind_create(const char *keybind);
2020-08-03 20:56:38 +01:00
2021-12-01 02:28:41 +00:00
/**
* parse_modifier - parse a string containing a single modifier name (e.g. "S")
* into the represented modifier value. returns 0 for invalid modifier names.
* @symname: modifier name
*/
uint32_t parse_modifier(const char *symname);
bool keybind_the_same(struct keybind *a, struct keybind *b);
void keybind_update_keycodes(struct server *server);
#endif /* LABWC_KEYBIND_H */