- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Hello
I don´t know how I can get the character that I press from the keyboard.
I used the example for Arduino IDE USB HOST, but I get a diferent character that I press , for example: I press the Q key, but the serial monitor shows:
Pressed: key:16 mod:1 => L-Ctrl m
Released: key:16 mod:0 => m
I understod that the program shows the OEM-code (What is that?). I want that the program shows the key that I press in the keyboard. For example: I press the Q key and the serial monitor shows the letter Q.
I appreciate your help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Hi giocaba,
I tried the same example and I'm having the same output. The OEM code means "Original Equipment Manufacturer" and the purpose of them is to identify a key in the keyboard not the character of it.
If you want that the Arduino sketch returns the character of the key you are pressing, you have 2 choices. One, modify the libraries so when you use .getKey() or .getOemKey() you get the character and not the OEM value. The other choice is to modify the sketch in order to manage the results you are getting and translate the OEM values into the character you want, for example:
You are getting 16 while pressing q, you can use this to create a routine that translates these numbers into the real character of the keyboard.
Regards,
Charlie
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Hi giocaba,
I tried the same example and I'm having the same output. The OEM code means "Original Equipment Manufacturer" and the purpose of them is to identify a key in the keyboard not the character of it.
If you want that the Arduino sketch returns the character of the key you are pressing, you have 2 choices. One, modify the libraries so when you use .getKey() or .getOemKey() you get the character and not the OEM value. The other choice is to modify the sketch in order to manage the results you are getting and translate the OEM values into the character you want, for example:
You are getting 16 while pressing q, you can use this to create a routine that translates these numbers into the real character of the keyboard.
Regards,
Charlie
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Hi Charlie,
Thank you for your help, I go to use the number and then get the real character.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page