How do I send a USB Keyboard # key

Status
Not open for further replies.

gi1mic

Member
I am trying to use the Teensy LC to emulate a UK laptop keyboard. Everything works great apart from the "#" key.

On a UK keyboard this is a separate physical key (near the enter key) that does not seem to exist on US keyboards. You see it here on this image:

800px-KB_United_Kingdom.svg.png



The common names for the key would be hash, pound or sharp but those don’t seem to exist as defines in the teensy keyboard code.

Does it have another name or how do I send that keypress?

I do have UK selected as the keyboard type in the IDE if that makes a difference and I do get a £ sign for a shifted numberic 3 where a normal US keyboard # key would appear.
 

Attachments

  • 800px-KB_United_Kingdom.svg.png
    800px-KB_United_Kingdom.svg.png
    38.1 KB · Views: 62
Sorry hopefully someone who has done this already can better answer. Wonder what this one does?
#define KEY_NON_US_NUM ( 50 | 0xF000 )

But again not sure.
 
Do you know the ASCII or unicode value for #? Can you just send that value when the key is pressed?

Just looked it up. It appears that "British pound" is 00A3 and # is 0023 hexidecimal in unicode.

Hope that helps.
 
0xA3 and 0x23 to be pedantic... :) That allows copy and pasting without forgetting the base, well in many languages at least.
 
Do you know the ASCII or unicode value for #? Can you just send that value when the key is pressed?

Just looked it up. It appears that "British pound" is 00A3 and # is 0023 hexidecimal in unicode.

Hope that helps.

Again I am no expert, but I have worked at it from the other side, in adding the ability for keyboards to be plugged into the USB Host of T3.6 and T4.x

What I remember is the keyboards will output some KeyCode that your software will interpret depending on things like country code or keyboard layout to convert the keycode(s) into the appropriate value that your application will see.
 
0xA3 and 0x23 to be pedantic... :) That allows copy and pasting without forgetting the base, well in many languages at least.

Except Unicode is 16 bits, so it is 0x00A3 and 0x0023.

A single byte is not big enough to handle all the special characters and symbols used in different languages.

See the Wikipedia Article on it.
 
Status
Not open for further replies.
Back
Top