Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

usb host keyboard: add keymap support #19

Open
wants to merge 4 commits into
base: imx_usb_host
Choose a base branch
from

Conversation

jepler
Copy link
Collaborator

@jepler jepler commented Jul 8, 2023

I'll let you decide whether to pull this into your PR, or would prefer me to PR this direct to adafruit after your PR's merged.

This is confined to pure ASCII, but does support Alt Gr. This is enough to make a French keyboard layout work:

  • home row is "qsdfghjklm"
  • numerals are all shifted
  • keys like {} require Alt Gr

While not tested, this should also support layouts like Colemak with the necessary keymap file.

Layouts can be produced from @Neradoc's keyboard layout modules on the device & loaded at runtime. Code to do so is at
https://gist.github.com/jepler/597c0a00e0eb014a433e03c0ae363a08
as well as a sketch of how an extended format could support dead keys & the full Unicode BMP instead of just ASCII.

import keyboard_layout_win_fr
import layout_to_settings
import usb
lay = layout_to_settings.layout_to_settings0(keyboard_layout_win_fr.KeyboardLayout)
usb.set_user_keymap(lay)

tannewt and others added 4 commits July 7, 2023 16:13
Connects up read, write and ctrl_transfer to TinyUSB. USB Host
support is available on iMX RT and RP2040.

Fixes adafruit#6527 (imx) and fixes adafruit#5986 (rp2).
This is confined to pure ASCII, but does support Alt Gr. This is enough
to make a French keyboard layout work:
 * home row is "qsdfghjklm"
 * numerals are all shifted
 * keys like {} require Alt Gr

While not tested, this should also support layouts like Colemak with
the necssary keymap file.

Layouts can be produced from Neradoc's keyboard layout modules on the
device & loaded at runtime. Code to do so is at
    https://gist.github.com/jepler/597c0a00e0eb014a433e03c0ae363a08
as well as a sketch of how an extended format could support dead keys &
the full Unicode BMP instead of just ASCII.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants