Commit Graph

54 Commits

Author SHA1 Message Date
24e354ce9e Add popup to display pressed keys 2023-09-06 15:29:07 +02:00
b1890848d5 Remove surface commits where it is unecessary and wrong 2023-09-06 14:25:40 +02:00
db44029d87 Add --alpha to configure all alpha color values 2023-08-31 11:41:20 +02:00
bfcd3527dd scroll wheel switches layers (as opposed to crashing as it did before) 2023-08-31 11:39:17 +02:00
2e476c6548 Made 'full' and 'simple' layouts less prone to mistyping and improved layout switching
- The full layout now squashes less keys in a row, to accomplish this
  the semicolon/colon, equal/plus and alt keys had to be sacrificed
  from the full layout (they're on the special/symbols layout still).
- The half-keys in the simple layout are removed, giving a bit more
  space.
- The default total keyboard height has been slightly enlarged (10px)
- The compose key moved down, it was too close to the 'a' (accidental
  presses). The tab key moved to the top-right.
- The spacing between the buttons is slightly larger (aesthetic only)
- The key for layer switching is now labelled more consistently with an icon, and indicates direction of switching with an arrow
- An extra "index" layout was added that can be activated by pressing
  Compose + the next/prev layout button. It has a key for each layout,
  even those not specified at start. This special layout does not appear
  in the normal layer cycling.
- The "Abc" key on secondary layers returns to the last alphabetical layout
- The compose layouts automatically hide when the user presses the space
  where there are no keys, no need to explicitly press the "Abc" key.
2023-08-31 11:39:17 +02:00
b6ec34fe3a fix scaling problem from "support multiple outputs" 2023-08-27 12:12:03 +02:00
79797fc837 support multiple outputs 2023-08-26 12:48:45 +02:00
9bbc8d4a99 main: Allow user to override layers in landscape mode
Add a new parameter `--landscape-layers` as well as an environment
variable `WVKBD_LANDSCAPE_LAYERS` that allows the user to override the
default set of layers in landscape mode. This complements the existing
`-l` parameter and `WVKBD_LAYERS` environment variable, which do the
equivalent for non-landscape mode.

Furthermore, add documentation for the new switch. Move the `-l`
parameter to the bottom so we don't have to realign all parameters and
so all layer-related parameters are grouped together.
2022-10-07 21:02:29 +02:00
acf38cf46e Add a --list-layers option
To get a list of available layers for the -l option.

Signed-off-by: Emmanuel LE TRONG <emmanuel.le-trong@cnrs-orleans.fr>
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
2022-08-16 17:29:50 +02:00
f446bf9147 fixup: code indentation fixes after last patch 2022-07-27 18:39:11 +02:00
e29b029308 add: args to customize keyboard colors (takes rrggbb or rrggbbaa values) add: function to set keyboard colors from rrggbb or rrggbbaa values fix: handle empty font arg
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
2022-07-27 18:30:11 +02:00
0cd0d5e1a1 layout: Implement spacing better
to no longer need overscan

Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
2022-07-10 22:52:22 +02:00
1843e60a74 only commit surface when it changed
Previously wvkbd would commit an (usually) unchanged surface at the
framerate of the compositor, this only commits the buffer when we render
something new.

Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
2022-07-05 22:13:21 +02:00
a2cacb7e25 use signalfd instead of signal
Switch to using signalfds because using the signal syscall was causing
problems without the frame callbacks (the change in the next commit), I
think this is because it would end up with multiple tasks polling the
same wayland file descriptor.

Previously this would exit after the second SIGPIPE signal. I checked
with earboxer on irc, and confirmed that handling all occurrences is the
correct behavior.

Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
2022-07-05 22:12:54 +02:00
dbe1e01fe9 call show instead of duplicating in startshidden check
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
2022-07-05 22:12:48 +02:00
c1b95f2700 reset layer index on rotation
If there are more layers in one orientation than the other this can
cause wvkbd to overshoot the end of the layer list when switching
layers. It also means that switching layers after rotating will jump to
the next layer in the list, which is somewhat unexpected.

Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
2022-07-05 18:08:14 +02:00
9d6696fb23 call kbd_resize when showing
Since layer_surface_configure was changed to only call kbd_resize when
an output dimension changed, kbd_resize doesn't get called if the
keyboard was hidden and is being shown again, meaning it doesn't tell
the compositor about the scale.

This causes it to only output the top-right quarter of the keybaord
stretched to the entire window size after a SIGUSR1 + SIGUSR2 cycle with
the display scale set to 2.

Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
2022-07-05 18:08:06 +02:00
f540cf36fa Use output dimensions to detect landscape mode
Most displays are in landscape mode by default, so checking to see if
it's rotated will produce the exact opposite of the expected results.

Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
2022-07-05 18:08:02 +02:00
22ff01fb8b Keyboard: Avoid unnecessary resizes
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
2022-06-25 15:19:33 +02:00
7be30a6a56 Check for surface in display_handle_geometry
Fixes #23

Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
2022-06-14 00:10:31 +02:00
e6c7d0ff2a main.c: add a real-time signal for toggling visibility of the keyboard
Previously it was only possible to either show or hide the keyboard.
When you want to control the keyboard with a single button in, i.e.
a window manager, this requires a separate script to keep track of
state. This solves this by only needing one signal to toggle.

Since there are only 2 USR signals, I had to use real-time signals,
which are in the [POSIX
standard](https://standards.ieee.org/standard/1003_1b-1993.html) and
available in the [Linux kernel since
2.2](https://www.man7.org/linux/man-pages/man7/signal.7.html).
2022-06-13 22:18:03 +02:00
c27f876634 main: prevent crash on sigpipe
This is commonly caused by a bad program in the output chain, e.g.

wvkbd -O | false
2022-06-13 21:56:49 +02:00
849f4600e9 project: rerun clang-format
TODO make a commit or PR hook for this
2022-06-13 21:55:47 +02:00
905a0d100a version: Output newline 2022-06-13 21:55:15 +02:00
2de12a90e4 output: add -O flag to output overlapped keys
the use-case for this is simple 'swipe'-typing:
another program can take the output, guess the word which is being typed, and type the rest of the word
2022-01-10 03:08:06 +00:00
7e4f6ac5d1 renamed freeze/unfreeze to more standard hide/show 2021-10-19 23:12:01 -07:00
0618da1d24 implemented a --hidden paramter to start hidden 2021-10-19 23:12:01 -07:00
bb1eff09be applied clang-format (no functional changes), but exempted custom include order in keyboard.c and main.c 2021-10-19 23:12:01 -07:00
3a241c8d2c Fix normal_height when using argument
This was overrided with rotation cause we dont save it
2021-10-19 23:12:01 -07:00
7a512fbca7 Add landscape height value 2021-10-19 23:12:01 -07:00
e100aafb05 Add landscape layers 2021-10-19 23:12:01 -07:00
450d43ff44 Handle hide and show signals 2021-10-19 23:12:01 -07:00
e73316bd7c WIP refacto keyboard.c 2021-10-19 23:12:01 -07:00
ff92a92086 refactored keymap loading 2021-10-19 23:12:01 -07:00
b5ec768822 WIP: refactorise keyboard.c 2021-10-19 23:12:01 -07:00
915d01c562 Cleanup some code 2021-10-19 23:12:01 -07:00
c8a02479a9 Remove useless variable 2021-10-19 23:12:01 -07:00
b65ea995f1 Simplify ctx initializer 2021-10-19 23:12:01 -07:00
bdfdf559b4 added --fn parameter to set font at run time 2021-10-19 23:12:01 -07:00
fb82daea9c Handle output scaling 2021-10-19 23:12:01 -07:00
c806023fd5 Drop wld and implement our own pangocairo renderer 2021-10-19 23:12:01 -07:00
8fdaaa2b6f fixed layout switching 2021-10-19 23:12:01 -07:00
19213688d1 allow supplying layers through command line parameter or env var 2021-10-19 23:12:01 -07:00
2fd0cfc89c implemented configurable layers 2021-10-19 23:12:01 -07:00
8a844c0857 made keymap dependent on layout, renamed default layout to 'mobintl' for 'mobile international' 2021-10-19 23:12:01 -07:00
07f153fe32 ran make format 2021-10-19 23:12:01 -07:00
878b16b997 cleanup indentation (tab) 2021-10-19 23:12:01 -07:00
447f655db3 fix memory leak 2021-10-19 23:12:01 -07:00
e3f414536e cleanup 2021-10-19 23:12:01 -07:00
20b2dc61c3 implemented support for multiple keymaps 2021-10-19 23:12:01 -07:00