config: add infrastructure to handle URL mode specific key bindings

* Add “show-urls” action to regular key bindings
* Add url-bindings section to foot.ini
* Add “cancel” action to URL mode key bindings
This commit is contained in:
Daniel Eklöf 2021-01-30 12:43:59 +01:00
parent 8f4a8cd8ce
commit ee39966ded
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
6 changed files with 190 additions and 1 deletions

View file

@ -49,6 +49,7 @@ enum bind_action_normal {
BIND_ACTION_PIPE_SCROLLBACK,
BIND_ACTION_PIPE_VIEW,
BIND_ACTION_PIPE_SELECTED,
BIND_ACTION_SHOW_URLS,
/* Mouse specific actions - i.e. they require a mouse coordinate */
BIND_ACTION_SELECT_BEGIN,
@ -59,7 +60,7 @@ enum bind_action_normal {
BIND_ACTION_SELECT_WORD_WS,
BIND_ACTION_SELECT_ROW,
BIND_ACTION_KEY_COUNT = BIND_ACTION_PIPE_SELECTED + 1,
BIND_ACTION_KEY_COUNT = BIND_ACTION_SHOW_URLS + 1,
BIND_ACTION_COUNT = BIND_ACTION_SELECT_ROW + 1,
};
@ -106,6 +107,17 @@ struct key_binding_search {
enum bind_action_search action;
};
enum bind_action_url {
BIND_ACTION_URL_NONE,
BIND_ACTION_URL_CANCEL,
BIND_ACTION_URL_COUNT,
};
struct key_binding_url {
struct key_binding bind;
enum bind_action_url action;
};
/* Mime-types we support when dealing with data offers (e.g. copy-paste, or DnD) */
enum data_offer_mime_type {
DATA_OFFER_MIME_UNSET,
@ -192,6 +204,7 @@ struct seat {
struct {
tll(struct key_binding_normal) key;
tll(struct key_binding_search) search;
tll(struct key_binding_url) url;
} bindings;
} kbd;