Hi,
USBComposite is working like a charm to simulate a keyboard.
But, how to deal with key-mapping ?
On my test machine I have a french keyboard (AZERTY) and a "Keyboard.press('a');" give a "q".
Is there a way to deal with this problem ?
Cheers,
Phil
USBComposite and keymapping
Re: USBComposite and keymapping
Background: https://stackoverflow.com/questions/393 ... d-keyboard
I guess you'll need to generate a map for the locale. I don't think there is a general solution on the stm side.
I guess you'll need to generate a map for the locale. I don't think there is a general solution on the stm side.
Re: USBComposite and keymapping
Hi Arpruss,
Thanks for the pointer.
As the project was for an event mid November, I've found a quick & dirt solution: I have map myself an AZERTY keyboard over the QWERTY template I've found. Just modify the output code with a translate table.
The major issue was the need of the key "Alt Gr" to obtain the specific chars related to this combo key. If someone have to do a similar job, have a look at the "modifiers". So the table is a char translation plus optionally the Alt Gr or Shift pressed and released.
It's so ugly, I can't show this mess ... But it worked as expected.
It's a shame I can't commit it, but as I'm not an expert of those HID devices, my patch will not be useful to someone aware of how it really works.
Cheers,
Phil
Thanks for the pointer.
As the project was for an event mid November, I've found a quick & dirt solution: I have map myself an AZERTY keyboard over the QWERTY template I've found. Just modify the output code with a translate table.
The major issue was the need of the key "Alt Gr" to obtain the specific chars related to this combo key. If someone have to do a similar job, have a look at the "modifiers". So the table is a char translation plus optionally the Alt Gr or Shift pressed and released.
It's so ugly, I can't show this mess ... But it worked as expected.
It's a shame I can't commit it, but as I'm not an expert of those HID devices, my patch will not be useful to someone aware of how it really works.
Cheers,
Phil
-
- Posts: 1
- Joined: Thu Feb 02, 2023 6:42 am
Re: USBComposite and keymapping
I had a similar problem. I will try it. Thank you!arpruss wrote: Tue Dec 27, 2022 3:10 pm Background: https://stackoverflow.com/questions/393 ... d-keyboard
I guess you'll need to generate a map for the locale. I don't think there is a general solution on the stm side.