Commit graph

99 commits

Author SHA1 Message Date
Your Name
5f2aa46ea9 move config to .config/unffettered-keyboard/unffetered.yaml 2025-11-06 21:10:40 +01:00
Your Name
a0d8bbd1f4 rounded corners 2025-11-06 20:37:41 +01:00
Your Name
604d2e4134 add xdg configs 2025-11-06 20:07:16 +01:00
Richard Acayan
c92b571c16 add evfbo (evdev + fbdev + stdout) backend
During a normal boot in the postmarketOS initramfs, the TTY is not
easily accessible. The on-screen keyboard is expected to send the
password to stdout instead of to a uinput device. Add the evfbo backend
to support full-disk encryption.
2025-07-21 19:25:35 -04:00
Richard Acayan
7b38edb656 add evfb (evdev + fbdev) backend
Outside of a terminal emulator or web browser, this typing experience
can be useful outside the DE, such as in the TTY or when entering a
password for full-disk encryption. Add a target that uses the bare
hardware to allow the keyboard to be deployed in more flexible
environments.
2025-07-21 19:25:35 -04:00
Richard Acayan
ac4673f870
core: config: revert change in default colors from !7
In !7, the default colors had their red and blue channels swapped. There
doesn't seem to be a stated (or inferrable) reason, so revert the color
change back.
2025-06-20 22:31:07 -04:00
Richard Acayan
c911577eb8
core: graphics: use pressed color for pressed keys
The locked label color is a special color that displays when the user
holds a modifier key for very long. In !7, this locked color replaced
the color for the pressed non-modifier key with no explanation. Revert
the change and use the "label_pressed" color for a non-modifier key
being pressed.
2025-06-12 23:20:45 -04:00
Frieder Hannenheim
a02f404832
Use color configuration options 2025-05-12 18:09:37 -04:00
Frieder Hannenheim
f6405cad69
core: config: Add configuration options for keyboard colors
[richard: prefix commit message with code modified and sign]
2025-05-12 18:09:29 -04:00
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
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
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
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
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
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
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
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
Richard Acayan
f3ba955ae4 core: add meta key
Some applications have features (like typing Unicode codepoints in foot)
that can only be used with key presses. Add a Meta key to allow the user
to always send a keypress.
2024-09-04 21:45:57 -04:00
Richard Acayan
0ebf6a8d5b wayland: truncate scaled width and height on configure
When a configure event is emitted, the updated graphical dimensions are
sent unscaled. Currently, the application applies fractional scaling to
the dimensions by truncating the scale to an integer. This is incorrect,
as scales could be fractional and the compositor would expect the
fractional scale to be applied to the width and height. Truncate the
width and height after scaling instead of truncating the scale to reduce
the right and bottom seams to 0-1 pixels.
2024-08-26 18:20:25 -04:00
Richard Acayan
e17e4f31f5 core: graphics: finish supporting glyphs extending past font descent
Extend the height of the label when a glyph goes past the descent.

Also truncate the bitmap when the height is final.

Also remove statements added for debugging.
2024-08-19 23:14:08 -04:00
Richard Acayan
70775b8350 core: graphics: adjust size for glyphs outside regular vertical bounds
Some glyphs, specifically some Arabic text, may have a top that is
higher than the ascent value of the font, or a bottom that is lower than
the descent value of the font. For glyphs that fit inside the area, the
ascent and descent should be used for aligning with the top or bottom of
a key respectively. For glyphs that do not, align the top and bottom of
the text with the top and bottom of the key.
2024-08-19 21:47:39 -04:00
Richard Acayan
ad9096e6b7 core: layout: remove unreachable statement
This statement is the source of a warning because the statement above it
is already a catch-all. Remove it.
2024-08-12 19:19:18 -04:00
Richard Acayan
cec38887b1 wayland: keyboard: remove keysym sanitizing
The NoSymbol and XF86Fn keysyms are already filtered out because they
are not available and because the function key is a keysym modifier.
Remove the sanitizing.
2024-08-12 19:16:33 -04:00