Commit graph

131 commits

Author SHA1 Message Date
bunnie
043dfd84ae update formatting to latest nightly rules 2024-09-24 01:49:45 +08:00
bunnie
34e6f46d63 formatting changes that resulted from the regex search
a bunch of lines are shorter or different length now which
triggers a mandatory reformat. this patch cleans that up,
so that going forward the manual rework patches are clearer and
not tied up with formatting patches.
2024-09-22 15:31:14 +08:00
bunnie
0fbca1cd4d cleanup a typecast ambiguity due to new API
Rust can't tell how to cast some u32_le into u32/usize automatically
due to confusion with the num_derive trait, so we have to explicitly
specify a chain of typecasts to clean up the conflict with the
new rkyv
2024-09-22 14:24:59 +08:00
bunnie
1b0fa6e04b regex search/replace instances of xous_ipc::String to String 2024-09-22 14:24:49 +08:00
bunnie
19dd39c7c8 quiet warnings in hosted mode 2024-06-20 01:57:11 +08:00
bunnie
11f9552b96 don't format key lookup tables 2024-01-14 22:53:45 +08:00
bunnie
a994cbd447 format services/keyboard
exceptions are made for the mappings/ modules, because they
are lookup tables and benefit from strict line-by-line ordering
with wide columns.
2024-01-14 22:24:08 +08:00
bunnie
680c8b88c7 fix missing init() methods in hosted mode emulation structures 2023-07-16 18:31:14 +08:00
Sean Cross
d4f4a100bb keyboard: install interrupt handler after ::new()
Signed-off-by: Sean Cross <sean@xobs.io>
2023-07-16 15:33:08 +08:00
wz
e08f4b89c5 Narrow down the exclude list to Apple PUA characters 2023-05-21 14:00:52 +03:00
wz
723cadaff0 Ignore key codes over 0xf000 on insert 2023-05-21 13:49:06 +03:00
Gianguido Sorà
523ec0ac80
services/keyboard: remove explicit early settings FLASH access
Use early_settings service.
2023-04-21 18:11:04 +02:00
bunnie
916ca1e11f expand key injection API.
this does mean your device is notably less secure if you're operating
with usb serial turned on, as a host can just inject arbitrary commands
into your device!
2023-04-16 02:23:59 +08:00
bunnie
51fe53bc83 fix #354
verified to address the issue at least in a simple test case

1) drop repeated keys instead of panic-unwrapping
2) reduce key repeat rate to something more sane
2023-04-04 00:06:59 +08:00
bunnie
02f9701546 make an explicit dvt feature to simplify flags 2022-12-08 17:42:12 +08:00
bunnie
4dd983bfc4 adjust security parameters for dvt build 2022-12-08 17:19:05 +08:00
Gianguido Sorà
8594c0ae14 chore: increment connection limit for keyboard
Needed for prefs restore
2022-11-02 17:57:06 +01:00
Gianguido Sorà
52578e7a3f feat: implement Display trait for keyboard::KeyMap 2022-11-02 17:56:41 +01:00
bunnie
67fc21fbdd harmonize hosted mode selection, but retain an explicit hosted flag
In general, hosted mode is assumed "by default" if the target
is not Xous. This allows packages to be built cleanly on command
lines that don't know to pass a --feature flag to specify a target.

However, an explicit "hosted" flag is still retained so that we
can confirm the build system intent. This saves us from the failure
mode that we thought we were building for target A, but accidentally
ommitted the flag, and instead we've been silently building for
"hosted" mode without any warning. The main consumer of the "hosted"
flag is now just the build.rs script inside of the utralib.
2022-10-25 17:21:02 +08:00
Jean-Pierre De Jesus DIAZ
6163414dd1
keyboard: Implement From instead of Into
Signed-off-by: Jean-Pierre De Jesus DIAZ <me@jeandudey.tech>
2022-10-12 15:38:35 +02:00
bunnie
4e40ae6c5d move from target selectors to feature selectors for back-ends
This will allow for e.g. xous on riscv32-imac but not a precursor
target, for example: by using feature selectors we get to have
a bigger range of targets that we support, such as for implementations
that haven't been upstreamed or have official target-triples.

The downsides are:

- patch override libraries don't absorb feature flags. so, for
example, the AES crate that is used to patch other crates won't
be aware of the target features without modifying the referencing
crates.

- features are normally meant to be additive, but target features
are mutually exclusive. The mutex is enforced by a check in
utralib that throws a panic on build if two targets are accidentally
selected at the same time.
2022-10-02 02:56:44 +08:00
bunnie
907ac038ff make keyboard observer send messages falliable
this is a partial work around for the status server queue
overflow problem on boot while handling user interactions
in the auto-update flow.
2022-07-19 04:08:39 +08:00
bunnie
e1d946a18d other items for keyboard layout backup/restore 2022-07-16 00:39:34 +08:00
bunnie
c46579117b add the "trusted init" check to hosted mode
need to debug a problem with the IMEF connecting/disconnecting
causing trusted init to fail when there is more than one
plugin in the system.
2022-06-18 01:30:49 +08:00
bunnie
9eec4436ea some comment bookkeeping and whitespace cleanup 2022-06-18 00:17:35 +08:00
bunnie
a91292509e only allow the observer of the key presses to be registered once 2022-06-18 00:15:00 +08:00
bunnie
6a583a5f0c the system as writ does not actually allocate an extra connection
Adjust the connection number back to 4. There isn't a connection
made for a keyboard backlight server anymore. This is necessary
for root key initialization to proceed.
2022-06-14 01:25:41 +08:00
bunnie
9760910991 do not renumber explicitly numbered enums
In general, if an enum has been explicitly numbered, it means
that there are crates that depend on the actual number assigned,
and changing them will break other crates.

This is done to allow for cross-compatibility reasons, for
example, going to a C FFI or to the standard library, where
we can't simply refer to a Rust crate to import the symbolic
enums and have the compiler figure out a consistent numbering
method.

Thus even though it's a bit "ugly", please assign only unused
numbers to new enums, and when old enums are retired, do not
re-use the number.
2022-06-14 01:23:48 +08:00
Gianguido Sorà
7985ad9a95 make the thing compile 2022-06-08 12:08:49 +02:00
Gianguido Sorà
c99ac0b3f5 Merge branch 'main' into gsora/backlight-on-keypress 2022-06-08 11:58:45 +02:00
bunnie
6f8590e4e7 fixup config flags on keyboard option 2022-06-08 04:37:08 +08:00
kelas
37d3e4973e don't block if the queue isn't empty 2022-06-07 19:21:43 +02:00
bunnie
ba874a653e make the rawserial path queue up to 128 characters if getchar() isn't live 2022-06-07 13:03:49 +08:00
bunnie
0d1244dc32 add a "rawserial" feature to the UART injection path 2022-06-06 14:10:31 +08:00
bunnie
62913a6560 meant to have keyboard injection as a feature. restore that. 2022-06-06 13:59:01 +08:00
bunnie
28a9d5bca7 add hooks so unsafe C-FFI calls can connect to the keyboard
- Opcodes are mapped to static IDs
- connection ID is now visible to someone who already owns
  the keyboard object. This can then be shared with the FFI
  interface to do calls to the keyboard server.
2022-06-06 03:56:05 +08:00
bunnie
72996bc453 add a facility for a simple blocking keyboard listener 2022-06-05 18:32:54 +08:00
Sean Cross
3ae9d8abf0 apps/services: remove xous::xous_main macro usage
This macro will be removed, since it is no longer necessary. Remove this
macro across the project and replace it with a standard `main()`
function.

Signed-off-by: Sean Cross <sean@xobs.io>
2022-05-31 13:33:30 +08:00
Gianguido Sorà
9b58fc6bf8 first somewhat working code 2022-05-20 12:40:32 +02:00
bunnie
3bfdc238a0 add support for keymaps in HID
remaps keys based on the assumed keymap based on the user's
preference for the keyboard layout on the device.

So far, only dvorak and QWERTY are supported.
2022-05-17 16:41:08 +08:00
Gianguido Sorà
cb2a3b442d intermediate commit 2022-05-14 11:17:26 +02:00
bunnie
a6af300157 don't repeat the menu key if it is press-held 2022-03-27 00:19:55 +08:00
bunnie
5d754efc07 reduce debug verbosity on braille 2022-03-17 17:56:52 +08:00
bunnie
6d98c5db3d fix braille keyboard mappings 2022-03-17 15:20:20 +08:00
bunnie
bbccf1c2a7 reached a reasonable integration point for tts until braille protos are in
tts is working fairly well and much more stably, menus and ui
elements are wired up for tts.

just waiting for the latest braille keyboard pcb to come in and
then we'll be able to fire off some prototypes...
2022-03-11 19:08:39 +08:00
bunnie
b498669003 use NIST SP800-38F (AES-KWP) to wrap the system key for the PDDB
this is instead of our lolfail ECB-based method with a check block.
2022-02-03 18:24:06 +08:00
bunnie
3f61a298a5 helps to map in the key-up 2022-02-03 03:39:28 +08:00
bunnie
8080c1db22 split mappings into separate files, and add azerty/qwertz mappings
totally untested, i'm sure I messed up a character or two.

I'm sure there will be opinions. Pull requests welcome!
2022-02-03 03:26:18 +08:00
bunnie
30910dbd4f add keyboard layout setting and retention
Keyboard setting is "the one and only" exception to user settings
that are saved without encryption. This is because you need your
keyboard layout to be set in order for you to type your password.
Thus, this needed a bit of a special-case to handle its storage record.

We decided to lop off 1 page from the loader and have it store
the keyboard layout code.

Let's hope we can have the discipline to really just store that
one word of information and not later be like "gee wally, you have
a whoooole 4092 unused bytes of space we can cram unencrypted
user settings in, sure would be a waste to not put those use those".
2022-02-03 02:46:37 +08:00
bunnie
5c91645ede Merge branch 'i18n-jp' into bunnie-dev 2022-02-01 01:04:43 +08:00