Commit Graph

75 Commits

Author SHA1 Message Date
e4f1b121eb Merge branch 'errors' into 'master'
rust: Fix compiler warnings

See merge request Librem5/squeekboard!445
2021-04-09 08:36:06 +00:00
ac03c26d5d rust: Fix compiler warnings 2021-04-01 16:30:53 +00:00
36d4f6726c language-terminal: Place keyboards in a sub-path 2021-04-01 16:05:44 +00:00
M33
e49de34d0e Revert "Update tests/meson.build"
This reverts commit 27cd8964d02e957fdecd00bfebc0a03e4b24ffe4
2021-04-01 15:17:53 +00:00
b578414655 Merge remote-tracking branch 'upstream/master' into latch 2021-03-31 09:48:29 +00:00
7b1755a489 renderer: Mark latched buttons differently than locked
There are some hacks here in the form of an extra field "appears_locked_from", which can be used to hint that the user should see the button as locked. Without it, there's some confusion on user side regarding buttons that change states unprompted.
2021-03-31 09:11:11 +00:00
676a2b60ac layout: Make it possible to opt out of latching per-key 2021-03-31 09:09:38 +00:00
a265427e8e Add Mod4 (Windows) key 2021-02-11 18:06:49 +01:00
a9ecc13185 Merge branch 'fallback' into 'master'
Better fallbacks

See merge request Librem5/squeekboard!415
2020-12-05 04:16:44 +00:00
fcd0eaddf2 layouts: Simplify the main flow of source list 2020-12-03 16:26:47 +00:00
ba2e191918 layouts: Use base as fallback for alternative layouts 2020-12-03 16:15:22 +00:00
cc4f14e8c6 data: Flattened layout fallback function 2020-12-03 15:47:44 +00:00
103e64b96c data: Made data flow in fallback clearer 2020-12-03 15:45:45 +00:00
9dcc4c9868 tests: Prefer the env var for finding test layouts
The builtin file path is embedded in the binary and subject to substitution, which makes it invalid when trying to build a .deb reproducibly.

Out of the two solutions, it's easier to make the change here rather than customize .debu building not to run tests reproducibly.
2020-11-28 18:57:54 +00:00
db298b0fb8 keymaps: Use multiple key maps, each within the limit of what Xorg can accept.
Key maps are switched on key press whenever needed.
2020-10-12 14:14:17 +00:00
4373cf7bc3 keymap: Concentrate special handling of BackSpace, which is implicit in Erase action 2020-10-12 13:57:53 +00:00
f64e5a3627 Merge branch 'multi_ke' into 'master'
Improve generation of key maps

See merge request Librem5/squeekboard!388
2020-10-12 09:13:29 +00:00
8cf6c5f948 syntax: Let older rustc understand symbolmap's lifetime 2020-10-06 10:32:07 +00:00
de3bf54dc9 data: Restore testability of action->keysym conversion 2020-10-06 10:32:07 +00:00
2219eb67e1 keymap: Generate from symbol map, not layout
Includes changes to the keymap string without which Xwayland won't work.
2020-10-06 10:31:28 +00:00
74479ff226 Expand key press detection to the edges of the view's bounding box
If you have a keyboard layout like the following:

A B C D
 E F G
H I J K

The E and G keys here should be pressed when clicking in the empty space
next to them. This is achieved by not checking the bounding boxes of
each key and instead just using the button and row offset to extend
buttons/rows to the edges of the view. Caching for the size and
position of rows is introduced to simplify implementation and possibly
improve performance.

Fixes #191
2020-09-26 01:37:23 +10:00
d93e9c2b11 rust: Fix deprecation warnings 2020-09-21 10:57:01 +00:00
ecfc45c2de build: Make compatible with Debian Bullseye
This commit is a bit bigger than it could have: Meson changes could have gone in separately from CI and Debian.

This commit looks more complicated than it should reasonably be. Alas, Cargo is a piece of work, and it doesn't let honest people just choose different versions of dependencies, leading to a cascade of misery. Several things were tried to curb the disaster:

- Cargo [feature] supports choosing dependencies, but doesn't support specifying dependency versions
- Cargo has a cfg() syntax in sections for choosing dependencies by build options, but it explicitly doesn't support selecting on features…
- Cargo allows choosing different dependencies based on features, so perhaps dependencies with different versions could live in stub crates pulled in as needed? Nope! If a dependency doesn't exist in the repo (and that's the point here), Cargo throws up its hands.

This means Cargo.toml needs to be generated based on the build type. More misery:

- we lose the simplicity of just doing `cargo.sh` for simple housekeeping like deps updates. HACKING.md was updated to reflect that. Perhaps that's inevitable - build options need to be like this.
- Some flaky adjustments needed in `cargo.sh` because of an additional argument that can be mistaken for an argument to the exec in `cargo run`.
- Specifying a custom `Cargo.toml` means Cargo can no longer find any tests, examples, benchmarks, or binaries, because it searches relative to the directory of `Cargo.toml`, which is now the build dir. Extra care needed to not forget about them now.

As soon as Cargo allows anything better for managing deps versions, the above should be undone in its favor.

Good side is that a couple bugs went away:

- build flags not always making it to Cargo
- arm64 builds were optional while they shouldn't
- test layouts in unit tests are loaded from an explicit directory now

The Bullseye versions of dependencies are canonical now, Buster considered legacy.
2020-06-24 15:51:21 +00:00
92e9d994fe modifiers: Support Control and Alt
Control and Alt are special in that they aren't expected to switch levels, and so don't need to change what characters are output.

Use in layouts by adding `modifier: Control` or `modifier: Alt` in place of `text: "foo"`.

The latching of the modifier will force the keyboard to emit raw key presses and prevent it from outputting text.
2020-02-28 11:21:07 +00:00
10178d204b Merge remote-tracking branch 'upstream/master' into center 2020-02-05 10:32:07 +00:00
0ac8c620fd Merge branch 'lock' into 'master'
Turn locking stateless

See merge request Librem5/squeekboard!322
2020-02-05 09:25:49 +00:00
37e1ed93a6 Merge branch 'text_input_enable' into 'master'
Submit and delete strings via text_input

See merge request Librem5/squeekboard!304
2020-02-03 15:06:25 +00:00
40b79f6209 layout: Center views relative to each other and the layout bounds 2020-02-02 18:07:28 +00:00
782d80a007 row: Eliminate angle 2020-02-02 17:11:25 +00:00
500c23beec locking: Lock keys statelessly
Locking is not determined by button state any more, but rather based on the view active at the moment. If pressing/locking a key results in the current view being active, the key is active. If locking a key results in the current view, the unlock view is activated.
2020-02-02 15:41:47 +00:00
7a588460bf setup: Connect ui to the state manager
This ensures that the layout type information is accessible to the state manager when new layout information arrive.

The should be thought of as a stopgap measure. A proper solution would be to separate the state properly, and probably turn layout information coming from random places into messages that some object (thread?) collects and displays.
2020-01-28 21:32:47 +00:00
de8aaa1a47 Merge remote-tracking branch 'upstream/master' into text_input_enable 2020-01-28 12:39:42 +00:00
585ed5e97d input_method: Use for erasing 2020-01-23 15:39:40 +00:00
c75e085dc8 logging: Unified to remove random eprint calls 2020-01-17 12:25:39 +00:00
ea84f4f031 logging: Try to improve common operations
This adds sugar for logging `Result`s with a handler, makes names evoke something closer to "logging" than "warning", tries to remove any redundant `Logging` where the module name will do, and introduces a type strictly for bad things happening.
2020-01-16 15:57:46 +00:00
e77eccf7db action: Rename Level to View 2020-01-08 18:52:09 +00:00
a799178b6a Merge branch 'logging' into 'master'
Logging

See merge request Librem5/squeekboard!288
2019-12-24 10:10:30 +00:00
e2b89e85f7 logging: Move all facilities to one file 2019-12-16 19:15:40 +00:00
257b97e9ca layout: Respect margins 2019-12-15 18:43:56 +00:00
5e700219f9 parsing: Remove bounds which weren't used anyway 2019-12-15 18:43:56 +00:00
dd21bfed8d positioning: Calculate sizes instead of storing, move position out of widgets
Sizes of widgets can be derived, so storing them was only for C compatibility. Similar with storing position inside of widgets.

Some layout margin and scaling changes could be introduced, meaning a possibility of visual differences.
2019-12-07 21:20:21 +00:00
36362291ef cleanup: Unbox View and Row
They are no longer referenced anywhere in C, so it's safe to let Rust memory management deal with them.
2019-12-07 17:19:39 +00:00
b252f7659b rust: Be compatible with older Rust 2019-11-27 16:52:50 +00:00
af6ad1fce6 buttons: Accept "text" and drop xkb keysym derivation 2019-11-27 16:52:50 +00:00
9571adb107 tests: Executable for testing layouts 2019-11-19 09:47:32 +00:00
3c0b142c4f warnings: Print at runtime, crash at test time 2019-11-19 08:29:57 +00:00
47c4119ab7 Add a popover menu to switch languages 2019-11-05 13:10:55 +00:00
c917a1f818 layout: Keep kind metadata in loaded layouts
It will come useful for applying per-kind styling later without having to give each layout a new stylesheet
2019-10-29 13:27:54 +00:00
bd3b27eceb build: Make borrowing compliant with older Rust 2019-10-29 13:21:46 +00:00
1b1fbed7de layouts: Change type based on shape 2019-10-29 13:21:46 +00:00