Commit graph

32 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
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
67f6538a8b
core: layout: handle extra "loc " keys 2024-11-07 18:44:18 -05:00
Richard Acayan
14cd2d930b
core: layout: add switch_greekmath key 2024-10-31 18:38:38 -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
e5d0716c0f core: button: add support for layout switching keys 2024-09-30 22:14:47 -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
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
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
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
d884e71d86 add yaml configuration
Example:

	%YAML 1.2
	---
	longpress_ms: 600
	repeat_ms: 25

	layout: latn_qwerty_us.xml

	wayland:
	  height: 185
2024-08-08 17:51:56 -04:00
Richard Acayan
c5c5fa4a49 core: layout: update key capability according to new key value 2024-08-07 19:25:34 -04:00
Richard Acayan
50bb5dd106 core: layout: treat insert key value as non-text 2024-08-05 18:33:16 -04:00
Richard Acayan
c262b744aa core: layout: modify tab with fn to a literal tab character 2024-08-05 18:26:35 -04:00
Richard Acayan
3bb02196db core: button: allow dragging to a text-only key part 2024-08-05 18:26:35 -04:00
Richard Acayan
fc829a96c4 core: button: emit key presses as text when available 2024-08-05 18:26:35 -04:00
Richard Acayan
399ab9deba core: layout: set the spacebar text as whitespace
If the key value can emit text, it should put the text to be emitted in
the text field. It should not put any special symbol for the key label,
and it should instead be a special case in the display_label() method.
2024-08-05 18:26:35 -04:00
Richard Acayan
c459405318 core: layout: store availability of text insertion 2024-08-05 18:26:35 -04:00
Richard Acayan
c152dc8468 core: layout: store keysym availability 2024-08-05 18:26:35 -04:00
Richard Acayan
00e55c9566 core: layout: drop display_symbol function
The display_label function supersedes the old display_symbol function.
Drop the old one.
2024-08-05 18:26:17 -04:00
Richard Acayan
498caa149f core: layout: use uppercase label when pressing shift 2024-07-31 17:01:29 -04:00
Richard Acayan
5aaaedb887 core: layout: add text property to key parts
Some keys may have no XKB key symbol, but still have the ability to emit
text. Examples include the "‹" (U+2039) and "›" (U+203A) characters. Add
the text property to key parts so they can emit text even with no key
symbol.

Also, for keys that were not modified by the Function key because they
had no XKB key symbol name, modify them.
2024-07-26 21:49:15 -04:00
Richard Acayan
78f389beaa treewide: use Rust 2018 import paths
Rust 2018 is required for D-Bus support with tokio/zbus.
2024-07-24 22:32:00 -04:00
Richard Acayan
dd67676840 core: layout: remove nopush comment
Public fields for the Key is fine. There are no methods for it.
2024-07-24 22:32:00 -04:00
Richard Acayan
90a32cc50c core: layout: fix indentation in is_label_modifier 2024-07-22 21:30:14 -04:00
Richard Acayan
c1c92c4d5e wayland: keyboard: release keys while the keymap is changing
Keeping the keys pressed can confuse some compositors, and the key codes
may change. Release any keys that are pressed while the keymap is
changing, and press them again afterwards.
2024-07-19 17:07:04 -04:00
Richard Acayan
4a6b261be0 rewrite in rust 2024-07-18 20:32:55 -04:00