mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-18 08:52:45 +00:00
Merge pull request #520 from betrusted-io/keymap-check
check keymap on every call to "type" over USB
This commit is contained in:
commit
ecefa68531
2 changed files with 5 additions and 2 deletions
|
|
@ -472,6 +472,7 @@ perform the Xous firmware upgrade. This requires running manual update commands,
|
||||||
- @gsora has added the `hidapi` - apps can now register a HID descriptor for custom interactions over USB. See `apps/hidv2` for democumentation.
|
- @gsora has added the `hidapi` - apps can now register a HID descriptor for custom interactions over USB. See `apps/hidv2` for democumentation.
|
||||||
- change kernel and loader targets to riscv-unknown-elf-none because `xous` is now a proper target (required for Rust 1.76 compatibility)
|
- change kernel and loader targets to riscv-unknown-elf-none because `xous` is now a proper target (required for Rust 1.76 compatibility)
|
||||||
- `curve25519-dalek` API is now at 4.1.2, thanks to @kotval for pulling it together. The new API removes `engine-25519` and rolls hardware allocate/release into the forked crate, similar to how sha2 was ported. `engine-25519` crate now removed from source tree, as it is now depracted since all the functionality was pulled into `curve25519-dalek`.
|
- `curve25519-dalek` API is now at 4.1.2, thanks to @kotval for pulling it together. The new API removes `engine-25519` and rolls hardware allocate/release into the forked crate, similar to how sha2 was ported. `engine-25519` crate now removed from source tree, as it is now depracted since all the functionality was pulled into `curve25519-dalek`.
|
||||||
|
- keymap is checked on every call to send a key to the USB keyboard. This allows us to toggle the keymap temporarily to allow typing into hosts with a different keymap (instead of requiring a reboot)
|
||||||
|
|
||||||
## Roadmap
|
## Roadmap
|
||||||
- Lots of testing and bug fixes
|
- Lots of testing and bug fixes
|
||||||
|
|
|
||||||
|
|
@ -85,8 +85,6 @@ pub(crate) fn main_hw() -> ! {
|
||||||
let tt = ticktimer_server::Ticktimer::new().unwrap();
|
let tt = ticktimer_server::Ticktimer::new().unwrap();
|
||||||
#[cfg(not(feature = "minimal"))]
|
#[cfg(not(feature = "minimal"))]
|
||||||
let native_kbd = keyboard::Keyboard::new(&xns).unwrap();
|
let native_kbd = keyboard::Keyboard::new(&xns).unwrap();
|
||||||
#[cfg(not(feature = "minimal"))]
|
|
||||||
let native_map = native_kbd.get_keymap().unwrap();
|
|
||||||
|
|
||||||
#[cfg(not(feature = "minimal"))]
|
#[cfg(not(feature = "minimal"))]
|
||||||
let serial_number = format!("{:x}", llio.soc_dna().unwrap());
|
let serial_number = format!("{:x}", llio.soc_dna().unwrap());
|
||||||
|
|
@ -1165,6 +1163,7 @@ pub(crate) fn main_hw() -> ! {
|
||||||
match view {
|
match view {
|
||||||
Views::FidoWithKbd => {
|
Views::FidoWithKbd => {
|
||||||
if usb_dev.state() == UsbDeviceState::Configured {
|
if usb_dev.state() == UsbDeviceState::Configured {
|
||||||
|
let native_map = native_kbd.get_keymap().unwrap();
|
||||||
let mut codes = Vec::<Keyboard>::new();
|
let mut codes = Vec::<Keyboard>::new();
|
||||||
if code0 != 0 {
|
if code0 != 0 {
|
||||||
codes.push(match native_map {
|
codes.push(match native_map {
|
||||||
|
|
@ -1262,6 +1261,9 @@ pub(crate) fn main_hw() -> ! {
|
||||||
match view {
|
match view {
|
||||||
#[cfg(not(feature = "minimal"))]
|
#[cfg(not(feature = "minimal"))]
|
||||||
Views::FidoWithKbd => {
|
Views::FidoWithKbd => {
|
||||||
|
// check keymap on every call because we may need to toggle this for e.g. plugging
|
||||||
|
// into a new host with a different map
|
||||||
|
let native_map = native_kbd.get_keymap().unwrap();
|
||||||
for ch in usb_send.s.as_str().unwrap().chars() {
|
for ch in usb_send.s.as_str().unwrap().chars() {
|
||||||
// ASSUME: user's keyboard type matches the preference on their Precursor device.
|
// ASSUME: user's keyboard type matches the preference on their Precursor device.
|
||||||
let codes = match native_map {
|
let codes = match native_map {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue