getChar function : to get the ASCII code of a pressed key

More
1 week 2 days ago #225 by ludojoey
byte getChar(bool willBlock);

Return the ASCII code of pressed key.
If willBlock is true, will wait until a key is pressed and return the ASCII code otherwise (false), returns 0 if no key pressed.

Alone or with Shift (both) : returns regular ASCII code of the key
Ctrl + letter keys: ASCII 1 to 26.
Ctrl + num key from 0 to 4: ASCII 27 to 31
Fctn + key: keycode + 127

"Alt" key is not taken in account (but can be easily added).

Feel free to change the code to adapt the function to your needs!

 
The following user(s) said Thank You: Franck, David

Please Log in or Create an account to join the conversation.

Time to create page: 0.179 seconds
Powered by Kunena Forum