Commit graph

1711 commits

Author SHA1 Message Date
Daniel Eklöf
7984b802b2
README: shortcuts (bindings) _can_ be changed 2020-03-12 17:33:52 +01:00
Daniel Eklöf
47fa91e02b
Merge branch 'bindings' 2020-03-12 17:26:02 +01:00
Daniel Eklöf
a7b90b514c
doc/foot.5: mention that *all* actions can be used in mouse bindings 2020-03-12 17:24:54 +01:00
Daniel Eklöf
0e00b6fa15
doc/foot.5: add an example that uses Shift 2020-03-12 17:21:48 +01:00
Daniel Eklöf
6657573866
Merge branch 'master' into bindings 2020-03-12 17:19:54 +01:00
Daniel Eklöf
5cbd0527d7
config: key-bindings: verify key combo isn't already mapped to another action 2020-03-12 17:19:09 +01:00
Daniel Eklöf
c58f9a9ef9
config: mouse-bindings: verify button isn't already mapped
A button may only be mapped to a single action. Detect when the user
tried to map the same button to multiple actions and error out.

To clear a binding (for example, to free up a button from the default
bindings), one can set the action it is bound to to
`NONE` (e.g. `primary-paste=NONE`).
2020-03-12 10:46:27 +01:00
Daniel Eklöf
60170f4738
changelog: user configurable key- and mouse bindings 2020-03-12 10:23:59 +01:00
Daniel Eklöf
45384839f0
config/input: implement mouse bindings
* New config section, "mouse-bindings", where bindings are defined on
  the form "action=BTN_<name>
* pointer_button() handler now scans the bindings list instead of
  hardcoding primary-paste to BTN_MIDDLE.
* The implementation handles single- double- and triple clicks in the
  bindings, but there is currently no way to define anything but a
  single-click binding in the configuration.
2020-03-12 10:20:05 +01:00
Daniel Eklöf
9fae38a4b2
config: 'invalid key' is always an error, not a warning 2020-03-12 10:19:21 +01:00
Daniel Eklöf
51a9ff6b04
quirks: weston_csd_{on,off}: don't do anything in fullscreen mode 2020-03-12 09:39:53 +01:00
Daniel Eklöf
65ff582358
bindings: add minimize/maximize/fullscreen actions
These actions are by default not bound to anything.
2020-03-12 09:34:09 +01:00
Daniel Eklöf
1f904fc257
quirks: weston_csd_{on,off}: don't do anything in fullscreen mode 2020-03-12 09:31:25 +01:00
Daniel Eklöf
5a89ac67eb
config: add str_to_bool() 2020-03-11 16:10:14 +01:00
Daniel Eklöf
2be999a752
Merge branch 'master' into bindings 2020-03-10 18:21:48 +01:00
Daniel Eklöf
57fe26955f
changelog: updated to mention fix for #3
I really need to learn to update the changelog **with** the fix...
2020-03-10 18:17:14 +01:00
Daniel Eklöf
aa1aa0c09d
terminal: appky scale factor when force-resizing on font reload
If we don't, we'll end up e.g. increasing the window size when moving
the window between outputs with different scaling.

Closes #3
2020-03-10 18:07:12 +01:00
Daniel Eklöf
9049488acc
client: log path we actually tried to connect to (and failed) 2020-03-10 18:06:10 +01:00
Daniel Eklöf
1c42fadcf7
client: update --server-socket usage to mention XDG_SESSION_ID 2020-03-10 18:06:10 +01:00
Daniel Eklöf
270604b318
wayland: remove empty line 2020-03-10 18:06:10 +01:00
Daniel Eklöf
8a6cfb738b
shm: we don't really handle SHM failures, so just abort() 2020-03-10 18:06:10 +01:00
Daniel Eklöf
cf5da1039f
shm: mmap returns MAP_FAILED, so use that as guard value 2020-03-10 18:06:10 +01:00
Daniel Eklöf
867dc836ab
shm: set pool_fd=1 after closing it, to avoid double-closing on error 2020-03-10 18:06:10 +01:00
Daniel Eklöf
7efe2c6c97
shm: try to mmap with MAP_UNINITIALIZED
This flag is expected to be ignored on most systems, but can't hurt to
try.
2020-03-10 18:06:10 +01:00
Daniel Eklöf
1581143b0b
shm: log errno error message too 2020-03-10 18:06:09 +01:00
Daniel Eklöf
39571a32c6
changelog: update 2020-03-09 21:11:41 +01:00
Daniel Eklöf
214ef146a2
doc/foot.1: keyboard shortcuts: add pointer to foot(5) 2020-03-09 20:32:15 +01:00
Daniel Eklöf
dba880a088
doc/foot.5: document key bindings 2020-03-09 20:22:04 +01:00
Daniel Eklöf
c993148635
main: free config if we fail to load the config 2020-03-09 20:04:25 +01:00
Daniel Eklöf
048edc58f1
config: load custom key bindings
This adds parsing of a new section - "key-bindings" - where the user
can configure the key bindings on the form "action=combo1 .. comboN"

The validity of the key combinations are checked with the default XKB
keymap.
2020-03-09 20:03:04 +01:00
Daniel Eklöf
0c72128405
input: parse_key_binding_for_action: export function 2020-03-09 19:47:22 +01:00
Daniel Eklöf
f78a8a77ed
input: parse_key_binding_for_action: repair LOG_DBG statement 2020-03-09 19:47:01 +01:00
Daniel Eklöf
fc7b3b2d85
Merge branch 'master' into bindings 2020-03-09 18:49:44 +01:00
Daniel Eklöf
25792a7e8c
server/client: add XDG_SESSION_ID to the default socket path
This allows multiple foot servers to run in multiple sessions.
2020-03-09 18:47:10 +01:00
Daniel Eklöf
6c6e3da7e2
term: init: no need to roundtrip 2020-03-09 18:46:50 +01:00
Daniel Eklöf
3e5f011f75
wayland: make a missing presentation time interface an error
If the user wanted to do presentation timing, and the interface isn't
there, then this is an error.
2020-03-09 18:46:09 +01:00
Daniel Eklöf
404365ec56
wayland: register FDM hook early, to avoid unregister errors when failing 2020-03-09 18:45:43 +01:00
Daniel Eklöf
217f16e434
.desktop: 'terminal' is not a common icon name
Not all icon themes have a 'terminal' icon. 'utilities-terminal' on
the other hand is a standardized icon name.
2020-03-09 18:44:43 +01:00
Daniel Eklöf
9e985cc358
footrc: add default key bindings
Note that we still don't parse this section.
2020-03-08 15:36:30 +01:00
Daniel Eklöf
cb21ede020
wayland: free 'search' key bindings on destroy 2020-03-08 15:30:05 +01:00
Daniel Eklöf
0d188895c3
search: add support for user configurable key bindings
No default bindings defined yet, though.
2020-03-08 15:28:47 +01:00
Daniel Eklöf
fcf4832775
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.
2020-03-08 15:17:57 +01:00
Daniel Eklöf
18313dcbec
config: csd: error out on invalid key 2020-03-08 14:08:48 +01:00
Daniel Eklöf
3bc6db1e8c
scripts/generate-alt-random-writes: use TIOCGWINSZ instead of shutil 2020-03-08 13:52:59 +01:00
Daniel Eklöf
b22bb30976
wip: initial framework for dealing with key/mouse bindings in different modes
This adds initial support for defining key and mouse bindings that are
applied in different terminal modes/states.

For example, there are two arrays dealing with key and mouse bindings
in the "normal" mode. Most bindings will go here.

There's also an array for "search" mode. These bindings will be used
when the user has started a scrollback search.

In the future, there may be a model selection mode as well. Or maybe
"search" and "modal selection" will be combined into a single
"keyboard" mode. We'll see.

Since the keyboard bindings depend on the current XKB keymap,
translation from the user specified key combination string cannot be
done when loading the configuration, but must be done when we've
received a keymap from the wayland server.

We should explore if it's possible to load some kind of default keymap
just to be able to verify the validity of the key combination strings
at configuration load time, to be able to reject the configuration at
startup.

A couple of key bindings have been added as proof of concept.

Mouse bindings aren't handled at all yet, and is likely to be
re-written. For example, we can probably translate the configuration
strings at configuration load time.
2020-03-08 12:08:46 +01:00
Daniel Eklöf
8cf3cec920
README: only the bundled PKGBUILD requires tllist+fcft to be installed system-wide 2020-03-06 23:22:42 +01:00
Daniel Eklöf
d30449a36f
README: font size adjustments are in half point steps 2020-03-06 23:12:45 +01:00
Daniel Eklöf
b7959859f2
README: space separate AUR packages 2020-03-06 21:41:48 +01:00
Daniel Eklöf
bab11a3d38
README: fix markdown markup of AUR links 2020-03-06 21:41:17 +01:00
Daniel Eklöf
c02cde6401
README: add links to Arch AUR packages 2020-03-06 21:40:10 +01:00