trustcrypto / OnlyKey-Firmware

The OnlyKey Firmware runs on the OnlyKey itself and provides the core functionality of OnlyKey.
https://docs.crp.to/firmware.html
212 stars 40 forks source link

Keyboard LAYOUT_DANISH_MAC #115

Closed Tobshobs closed 3 years ago

Tobshobs commented 3 years ago

This commit adds Danish MAC keyboard layout to the firmware.

It might be working fine as is, but it is untested on the Onlykey hardware.

If needed Tim, I can test this LAYOUT_DANISH_MAC support if you send me an OnlyKey loaded with firmware supporting this.

I have not changed the following initial setup which is identical to LAYOUT_DANISH in keylayout.c:

SHIFT_MASK=0x0040; ALTGR_MASK=0x0080; DEADKEYS_MASK=0x0700; CIRCUMFLEX_BITS=0x0100; ACUTE_ACCENT_BITS=0x0200; GRAVE_ACCENT_BITS=0x0300; TILDE_BITS=0x0400; DIAERESIS_BITS=0x0500; KEYCODE_MASK=0x07FF; DEADKEY_CIRCUMFLEX=KEY_RIGHT_BRACE + SHIFT_MASK; DEADKEY_ACUTE_ACCENT=KEY_EQUAL; DEADKEY_GRAVE_ACCENT=KEY_EQUAL + SHIFT_MASK; DEADKEY_TILDE=KEY_RIGHT_BRACE + ALTGR_MASK; DEADKEY_DIAERESIS=KEY_RIGHT_BRACE; KEY_NON_US_100=63;

... I may not fully understand those functions, but to me it seems it would make sense to leave as is.

onlykey commented 3 years ago

@Tobshobs I manually added your changes here https://github.com/trustcrypto/OnlyKey-Firmware/commit/84c051455bdb9d3063b7cec86c62772a7d467ee2

What we will do is include this in next firmware release but won't add support for setting this in the OnlyKey app until you are able to test it out. You will be able to activate it to test using the OnlyKey CLI here - https://github.com/trustcrypto/python-onlykey

$ onlykey-cli keylayout 26