Commit graph

114 commits

Author SHA1 Message Date
Richard Acayan
d751e01b21
core: layout: make meta key and layout switchers always pressable 2025-04-08 22:24:58 -04:00
Richard Acayan
a58f567715
core: layout: check if new key is supported when modifiers are updated
Some modifiers update key values. If the old values are unsupported
(e.g. "¢") but the new values are supported (e.g. "c"), the keyboard
should let the user press the new value. Check if the new key value
is supported instead of the old one.
2025-03-28 22:33:06 -04:00
Richard Acayan
94e242af17 Cargo.toml: bump to version 3.0.0 2025-03-27 22:07:19 -04:00
Richard Acayan
863ec2938d core: layout: fix some clippy warnings in get_keysym_by_name
Convert the vector reference to a slice and use the strip_prefix
function when detecting "loc " hideable keys.
2025-03-27 22:07:19 -04:00
Richard Acayan
52b48b0474 Cargo.toml: update dependencies 2025-03-27 22:07:19 -04:00
Richard Acayan
f2c3f01120 Cargo.toml: remove extra version constraint for zbus, tokio, and bindgen
The zbus and tokio dependencies have an API that shouldn't break without
a major version change. Rely solely on the major version number to tell
Cargo which package to use.

For bindgen, macro version numbers should be omitted.
2025-03-27 22:07:19 -04:00
Richard Acayan
9ebd4ed7c5 core: layout: mark layout switcher for Greek math as non-text
The "switch_greekmath" key doesn't emit text. The Shift modifier
shouldn't make the key label uppercase. Mark it as a key that doesn't
emit text.
2025-03-27 22:07:19 -04:00
Richard Acayan
7994a2594b dbus: depend directly on futures-util for StreamExt trait
The zbus package currently doesn't re-export futures-util. Depend
directly on futures-util to listen for incoming signals.
2025-03-27 22:07:17 -04:00
Richard Acayan
14b038a8c0
Cargo.toml: upgrade tokio to 1.42 2024-12-26 20:44:57 -05:00
Richard Acayan
3220fa0a68
README: guide the user to install greekmath.xml
The command says numeric.xml which was already installed in a previous
command. Correct it to say greekmath.xml.
2024-12-26 20:44:34 -05:00
Richard Acayan
d8d110018b
kde, gnome: join with blocking event loop 2024-11-29 17:53:23 -05:00
Richard Acayan
9ce953ef09
treewide: update dependencies to latest version 2024-11-27 22:05:25 -05:00
Richard Acayan
67f6538a8b
core: layout: handle extra "loc " keys 2024-11-07 18:44:18 -05:00
Richard Acayan
d9956baffa
core: config: add extra_keys property
According to the layout XML format, keys prefixed with "loc " should
have an option to hide or show them. Add a property to facilitate this
configuration. Keep the array sorted so it can be binary searched for
the existence of an element.
2024-11-07 18:17:01 -05:00
Richard Acayan
14cd2d930b
core: layout: add switch_greekmath key 2024-10-31 18:38:38 -04:00
Richard Acayan
03b6d4509b
core: button: add switch_greekmath functionality 2024-10-31 18:38:34 -04:00
Richard Acayan
92983bcc99
core: graphics: add switch_greekmath label flags
The label for the layout switcher should be gray and have a small font.
Add the flags for it.
2024-10-31 18:37:55 -04:00
Richard Acayan
bb2a2c24f9
core: graphics: set secondary flag for number key switcher label
The switch_numeric key label should be grey. Set the flag for a
secondary key label.
2024-10-31 18:37:50 -04:00
Richard Acayan
ab035f1b2c
core: layout: add hardcoded greekmath layout
Add the built-in layout for Greek and math characters.
2024-10-31 18:32:42 -04:00
Richard Acayan
4a55205202
core: layout: correctly convert character to keysym
Some characters, such as U+03A3 (GREEK CAPITAL LETTER SIGMA) don't
convert directly to the proper key symbol. Use a xkeysym library
function to do correct conversions.
2024-10-31 18:30:28 -04:00
Richard Acayan
1323cada17
wayland: enable keys emitting key events on reis capability
When key events can be emitted with the Emulated Input protocol, this
can cause more keys to be supported. Update the supported keys when a
keyboard is received so some keys can be enabled immediately, without
switching the layout.

Fixes: 030ca29ddd ("wayland: add optional reis emulated input support")
2024-10-29 22:22:33 -04:00
Richard Acayan
95fe5521c2
Cargo.toml: bump to version 2.1.1 2024-10-21 18:36:24 -04:00
Richard Acayan
1e2c3d2ef4
wayland: keyboard: unlink keymap file after creation
The SHM pools in the buffer code can be removed immediately after
creation. This allows the filesystem to be clean after the application
closes. After files are unlinked, they are not deleted until all open
file descriptors are closed, such as the handle passed to Wayland.
Unlink the keymap file after it is created from the filesystem.
2024-10-21 18:25:36 -04:00
Richard Acayan
bffe08cbed
README: add numeric.xml to list of required layouts
Since the numeric layout got supported, the XML file defining the layout
was required. Add it to the list of required layouts in the README so
users can still install and run the current keyboard.

Fixes: e5d0716c0f ("core: button: add support for layout switching keys")
Link: https://gitlab.com/flamingradian/unfettered-keyboard/-/issues/7
2024-10-20 21:58:10 -04:00
Richard Acayan
283b88c51e
README: add license 2024-10-17 21:57:40 -04:00
Richard Acayan
5ed1c6c68e Cargo.toml: bump to version 2.1.0 2024-10-17 21:35:50 -04:00
Richard Acayan
0c48bd7ed0
add KDE target
Key presses can be sent to kwin with the EI (Emulated Input) protocol.
Connecting is handled by the xdg-desktop-portal D-Bus APIs and the
current D-Bus implementation is large. Add a separate target for KDE.
2024-10-17 21:34:53 -04:00
Richard Acayan
030ca29ddd
wayland: add optional reis emulated input support
Add support for the Emulated Input protocol using the Rust library.
2024-10-17 21:31:48 -04:00
Richard Acayan
89c96c511a
wayland: keyboard: add reis emulated input support
The Emulated Input (EI) protocol allows applications to send input
events through a distinct connection to the server, instead of through
Wayland. Add support for sending key presses through this protocol.
2024-10-17 21:31:38 -04:00
Richard Acayan
ff24a39214
Cargo.toml: add remotedesktop support
The ashpd and reis dependencies are required for using an
xdg-desktop-portal to connect to an Emulated Input Server. Add them to
prepare for better support on KDE.
2024-10-17 21:31:26 -04:00
Richard Acayan
323dba04ed
Cargo.toml: omit micro version number of dependencies
Cargo automatically chooses the micro version of each dependency. Do not
specify the micro version number as it is ignored.
2024-10-17 21:31:06 -04:00
Richard Acayan
2eba66cca7 Merge branch 'input-method-enable' of https://gitlab.com/flamingradian/unfettered-keyboard into HEAD 2024-10-17 21:12:30 -04:00
Richard Acayan
087f023657 Cargo.toml: bump to version 2.0.1 2024-10-17 21:11:28 -04:00
Richard Acayan
7ee647b971
Cargo.toml: remove KDE target
This shouldn't be here yet. Remove it.
2024-10-16 19:40:22 -04:00
Richard Acayan
5c9e7ce35b
Cargo.toml: add license to package metadata 2024-10-16 18:30:29 -04:00
Richard Acayan
2c2554d3db
COPYING: rename license to remove inaccurate license label
The code has always been licensed as GPL-3.0-only as shown by the SPDX
License Identifiers. Gitlab does not understand this and needs to stop
mislabelling the license. Rename the license so the inaccurate license
identifier stops showing on Gitlab.
2024-10-16 18:29:17 -04:00
Richard Acayan
d3d28a310d core: graphics: update scale when layout changes
With the new layout switching, the size of the layout can change. The
scale depends on the size of the layout. Update the graphics scale when
the layout changes.
2024-09-30 22:14:48 -04:00
Richard Acayan
e5d0716c0f core: button: add support for layout switching keys 2024-09-30 22:14:47 -04:00
Richard Acayan
71ca235a09 core: graphics: add label metadata for layout switching keys
Add properties for these labels so they can be used in keys that switch
the layout.
2024-09-30 22:12:59 -04:00
Richard Acayan
317a11d17c wayland: surface: inline trivial methods 2024-09-30 22:11:18 -04:00
Richard Acayan
0b985cefdb core: move scaling of input positions into core
The core may need to control the scale of the input positions to layout
positions, such as when the layout is changed. Handle the scaling of
input positions in the button of the keyboard.
2024-09-30 22:08:53 -04:00
Richard Acayan
0fa318ca7e core: layout: use built-in uppercase function for shift modifier
There are uppercase symbols outside the Latin alphabet. Use the built-in
uppercase function for displaying uppercase text due to the shift key.
2024-09-30 22:05:06 -04:00
Richard Acayan
0206b82a94 core: config: remove stray print statement
This print statement was for debugging, but configuration works properly
now. Remove the stray statement.
2024-09-30 22:05:06 -04:00
Richard Acayan
7276aa9f91 wayland: only bind to input method when enabled
Having multiple input methods at once causes behaviour defined by the
Wayland compositor. In a recent update by Phoc, the most recently
started input method would take priority to demonstrate the instability.

Since the keyboard driver for Wayland can handle a emitting input
without an input method, only try to bind to an input method when it is
enabled.
2024-09-28 10:23:06 -04:00
Richard Acayan
4cd29eec3b core: config: add config option to enable the wayland input method
Having multiple input methods at once causes behaviour defined by the
Wayland compositor. In a recent update by Phoc, the most recently
started input method would take priority to demonstrate the instability.
Add a configuration option so the Wayland input method can be disabled
to accommodate a second input method.

Also update the README with the new option.
2024-09-27 22:09:20 -04:00
Richard Acayan
57265544ab core: layout: omit bottom row when explicitly disabled by main layout
The main layout (e.g. latn_bone.xml and latn_neo2.xml) may disable the
bottom row by adding a property to the XML keyboard tag. Omit the bottom
row when this is the case.
2024-09-26 19:36:51 -04:00
Richard Acayan
1391589ce0 core: layout: resize bottom row according to main layout
In the Unexpected Keyboard, the bottom row always has the width of the
main layout despite being defined with a width of 10 units. Resize the
bottom row according to the main layout to improve layouts like
arab_pc.xml and numeric.xml.
2024-09-26 19:32:38 -04:00
Richard Acayan
253575febd core: layout: separate layout file parsing into new struct
Some fields in the layout can be abandoned when parsing is complete. The
code for opening and parsing a file is partially duplicated for the main
layout and bottom row. Separate the parsing into a new struct to make
the individual results easier to work with.
2024-09-26 17:19:43 -04:00
Richard Acayan
81aae23fe7 wayland: keyboard: assign static key codes for some keys
Some applications like Waydroid and Klavaro (with the Enter key) ignore
the keyboard layout and expect a key code from the Linux input UAPI.
Assign static key codes for keys on the QWERTY layout so some keys can
still work with these applications.
2024-09-25 19:53:13 -04:00
Richard Acayan
e8a3995710 wayland: buffer: add comments to outline some non-trivial functions 2024-09-20 21:23:06 -04:00