rust-embedded-community / pc-keyboard

PS/2 Keyboard Decoder in Rust
Apache License 2.0
96 stars 28 forks source link

add de104 keyboard layout #13

Closed ghost closed 2 years ago

ghost commented 2 years ago

adds the german keyboard layout

vinc commented 2 years ago

Hello, I tested your layout in MOROS and every chars that my OS can print looks good, including ä, ö, and ü, but the < key at the bottom left of that image doesn't produce anything: https://en.wikipedia.org/wiki/File:KB_Germany.svg

I think the following PR had the same issue: https://github.com/rust-embedded-community/pc-keyboard/pull/8

Does that key work for you @kevtechXx?

ghost commented 2 years ago

Nope it also doesn't work for me. On german keyboards the < key returns keycode 0x56 which doesn't get decoded by both ScancodeSet1 and ScancodeSet2 :/

thejpster commented 2 years ago

I believe the fix is to change https://github.com/rust-embedded-community/pc-keyboard/blob/50d9ced8f58a2f14762c76300b101e5538ec0e57/src/scancodes.rs#L159 and emit a new enumerator called something like KeyCode::Oem102. You can then check for that keycode and emit <, > or | as appropriate.

thejpster commented 2 years ago

The name OEM 102 was taken from https://kbdlayout.info/kbdgr/scancodes

thejpster commented 2 years ago

Also, thank you for the PR!