Keyboard icon indicating copy to clipboard operation
Keyboard copied to clipboard

when I use Keyboard.h, could I press keycode instead of keyASCII?

Open ljq29 opened this issue 5 years ago • 10 comments

It is generally accepted that when the header file Keyboard.h is used, some control keys can be sent through the Keyboard.press (key) function. But for keys without ASCII values, such as KEYCODE_VOLUME_UP and KEYCODE_VOLUME_DOWN, how should they be sent to the host through arduino?

ljq29 avatar Dec 03 '19 14:12 ljq29

0x80 Keyboard Volume Up 0x81 Keyboard Volume Down 0x7F Keyboard Mute You can also see the list here

anaicagrouver avatar Mar 04 '20 15:03 anaicagrouver

@ljq29 you can use hex codes for this

thekunalsaini avatar Mar 18 '20 12:03 thekunalsaini

@ljq29 you can use hex codes for this

So, from where I can find the table of keycode 2 hex?

ljq29 avatar Mar 18 '20 13:03 ljq29

@ljq29 Google it man it is easily available

thekunalsaini avatar Mar 18 '20 15:03 thekunalsaini

If @ljq29 you are satisfied give a good feedback ;)

thekunalsaini avatar Mar 18 '20 15:03 thekunalsaini

KEYCODE_VOLUME_UP and KEYCODE_VOLUME_DOWN

On the keyboards I tried, these keys use a different endpoint and a different protocol than all the “regular” keys. They can thus not be sent by the Keyboard library. Not without heavy modifications.

edgar-bonet avatar Oct 18 '21 11:10 edgar-bonet

KEYCODE_VOLUME_UP and KEYCODE_VOLUME_DOWN

On the keyboards I tried, these keys use a different endpoint and a different protocol than all the “regular” keys. They can thus not be sent by the Keyboard library. Not without heavy modifications.

What about functional keyboard? Some keyboard do have VOLUME_UP and VOLUME_DOWN key, such as logitech K380.

ljq29 avatar Oct 18 '21 13:10 ljq29

@ljq29: Yes, that is what I am talking about. I have a couple of keyboards that, in addition to all the regular keys, have these VOLUME_UP and VOLUME_DOWN keys. My tests show that those keys are sent through a different USB endpoint.

edgar-bonet avatar Oct 18 '21 14:10 edgar-bonet

@ljq29: Yes, that is what I am talking about. I have a couple of keyboards that, in addition to all the regular keys, have these VOLUME_UP and VOLUME_DOWN keys. My tests show that those keys are sent through a different USB endpoint.

So, is this libraries will not support VOLUME_DOWN and VOLUME_UP keys?

ljq29 avatar Oct 23 '21 11:10 ljq29

@ljq29: Indeed. This library does not support the VOLUME_DOWN and VOLUME_UP keys.

edgar-bonet avatar Oct 23 '21 16:10 edgar-bonet