Skip to content

International keyboard #25

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

Closed
Hans-MartinHannibalLauridsen opened this issue Nov 1, 2019 · 7 comments
Closed

International keyboard #25

Hans-MartinHannibalLauridsen opened this issue Nov 1, 2019 · 7 comments
Labels
conclusion: resolved Issue was resolved topic: code Related to content of the project itself type: enhancement Proposed improvement

Comments

@Hans-MartinHannibalLauridsen

Could we get support for international keyboards? Or atleast a refactor witch would make it possible for the community to create there own keyboard layouts with support for multicharacters/special characters?

@dotto59
Copy link

dotto59 commented Nov 22, 2019

I think it's not so hard to implement, just need a few directives to let us choose from different files where we can store different versions of current _asciimap[] array of Keybpoard.cpp (default), thus allowing to have external "KeyboardXX.h" files (e.g. "KeyboardFR.h", "Keyboard IT.h" and so on) to be included, depending on language setting (a specific KEY_LANGUAGE symbol, e.g. "#define KEY_LANGUAGE IT").
What's a bit hard to do is create KeyboardXX.h files with proper language-specific keycodes, but the community could help with that...
Another thing could be to use an extended ASCII table for specific language characters, i.e. by expanding _asciimap[] to a full 256 elements, or by adding an _extendedasciimap[] with upper 128 characters.

@Hans-MartinHannibalLauridsen
Copy link
Author

Hans-MartinHannibalLauridsen commented Nov 22, 2019

I don't believe it is that simple, there need to be a fundamental change to the way characters are mappped, as most special characters simply does not fit into a char, the C implementationer only allocates 1byte! Which does not make room for much other that ASCII, unicode or what ever does not fit into a single byte.

@ljq29
Copy link

ljq29 commented Dec 5, 2019

I think it's not so hard to implement, just need a few directives to let us choose from different files where we can store different versions of current _asciimap[] array of Keybpoard.cpp (default), thus allowing to have external "KeyboardXX.h" files (e.g. "KeyboardFR.h", "Keyboard IT.h" and so on) to be included, depending on language setting (a specific KEY_LANGUAGE symbol, e.g. "#define KEY_LANGUAGE IT").
What's a bit hard to do is create KeyboardXX.h files with proper language-specific keycodes, but the community could help with that...
Another thing could be to use an extended ASCII table for specific language characters, i.e. by expanding _asciimap[] to a full 256 elements, or by adding an _extendedasciimap[] with upper 128 characters.

In this issue #26, I want to send KEYCODE_VOLUME_UP and KEYCODE_VOLUME_DOWN, how should they be sent to the host through arduino?

@Hans-MartinHannibalLauridsen
Copy link
Author

I extend the library, or change the ascii table if you are Lucky enough that those media Keys fit into one byte, which I expect they don`t. Or use the much better lib https://github.com/NicoHood/Hid.

@ljq29
Copy link

ljq29 commented Dec 7, 2019

I extend the library, or change the ascii table if you are Lucky enough that those media Keys fit into one byte, which I expect they don`t. Or use the much better lib https://github.com/NicoHood/Hid.

Hi.
I am trying to write a sketch controlling an android device. Right-clicking an ordinary mouse generates a back event. But AbsoluteMouse.click(MOUSE_RIGHT); not working for me. Also, I was not able to find a key combination or key code for the events "Back" and "Home". Could you please help me?

PS. It seems that the "Back" event can be obtained using Win + Backspace, but I still did not understand how to get it.

@edgar-bonet
Copy link
Collaborator

This issue has been fixed in version 1.0.3, with some limitations:

  1. Only ASCII characters are supported.
  2. While both the Shift and AltGr modifiers are supported, using both simultaneously for typing a single character is not supported.
  3. Characters requiring hitting multiple keys consecutively (like dead circumflex + space → ^ on some layouts) are not supported.

Lifting those limitations would significantly increase the size and/or complexity of the library. See PR #53 for details.

The currently supported keyboard layouts are: da_DK, de_DE, en_US, es_ES, fr_FR, it_IT and sv_SE. If you want to contribute another layout, please see the comments in the file src/KeyboardLayout.h.

@per1234
Copy link
Contributor

per1234 commented Mar 6, 2022

Closing as resolved by #53
Thanks @edgar-bonet!

@per1234 per1234 closed this as completed Mar 6, 2022
@per1234 per1234 added conclusion: resolved Issue was resolved topic: code Related to content of the project itself type: enhancement Proposed improvement labels Mar 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conclusion: resolved Issue was resolved topic: code Related to content of the project itself type: enhancement Proposed improvement
Projects
None yet
Development

No branches or pull requests

5 participants