mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-04-15 08:21:03 -04:00
input: convert the rest of the normal key bindings to configurable bindings
New actions defined and implemented: * scrollback up/down * font size up/down/reset * spawn terminal Break out key combo parsing to a new function, parse_key_binding_for_action(). This function parses a string containing one or more space separated key combo definitions on the form (mod1+mod2+...+key), where key is a XKB key name (e.g. KP_Add). Convert all hardcoded key bindings to configuration based bindings. These still cannot actually be configured by the user, but at least lives in the conf struct.
This commit is contained in:
parent
b22bb30976
commit
fcf4832775
4 changed files with 107 additions and 83 deletions
11
wayland.h
11
wayland.h
|
|
@ -42,10 +42,16 @@ struct monitor {
|
|||
};
|
||||
|
||||
enum binding_action {
|
||||
BIND_ACTION_SCROLLBACK_UP,
|
||||
BIND_ACTION_SCROLLBACK_DOWN,
|
||||
BIND_ACTION_CLIPBOARD_COPY,
|
||||
BIND_ACTION_CLIPBOARD_PASTE,
|
||||
BIND_ACTION_PRIMARY_PASTE,
|
||||
BIND_ACTION_SEARCH_START,
|
||||
BIND_ACTION_FONT_SIZE_UP,
|
||||
BIND_ACTION_FONT_SIZE_DOWN,
|
||||
BIND_ACTION_FONT_SIZE_RESET,
|
||||
BIND_ACTION_SPAWN_TERMINAL,
|
||||
BIND_ACTION_COUNT,
|
||||
};
|
||||
|
||||
|
|
@ -54,6 +60,7 @@ struct key_binding {
|
|||
xkb_keysym_t sym;
|
||||
enum binding_action action;
|
||||
};
|
||||
typedef tll(struct key_binding) key_binding_list_t;
|
||||
|
||||
struct kbd {
|
||||
struct xkb_context *xkb;
|
||||
|
|
@ -81,7 +88,9 @@ struct kbd {
|
|||
bool ctrl;
|
||||
bool meta;
|
||||
|
||||
tll(struct key_binding) key_bindings;
|
||||
struct {
|
||||
key_binding_list_t key;
|
||||
} bindings;
|
||||
};
|
||||
|
||||
struct wl_clipboard {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue