7 years, 6 months ago.

USB keyboard CR carriage return

Hi

I am using USB keyboard library. After sending keystroke I need to send CR (return) key.

for example :

keyboard.keyCode('s'); wait_ms(50); keyboard.keyCode(0x13); CR

In accordance to ASCII code table 0x13 is a CR but it doesn't work in my case. However I tried vertical TAB 0x09 and it surprisingly worked. Can anybody help me to implement CR? Explain the problem I am experiencing with CR.

Thanks,

Kamil

2 Answers

7 years, 6 months ago.

The enter key is code 0x0a

Accepted Answer

Thank you Andy and Zoltan. 0x0a, New line fixed my issue with enter. All works fine.

posted by Kamil Kanas 09 Jun 2017

Hi, where can i found the key codes?

The ones provided in the USBKeyboard.cpp don't work.

Thanks.

posted by andrea darke 09 Mar 2018
7 years, 6 months ago.

Hello Kamil,
Isn't the ASCII code for CR equal to 13(decimal) = 0x0D?

However, in case you need the Enter key code (New line) then Andy is right.

posted by Zoltan Hudak 09 Jun 2017