Skip to content

Space key key code does not exist in USBHIDKeyboard.h #8918

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
1 task done
HSBL-ko-gyo opened this issue Nov 25, 2023 · 3 comments
Closed
1 task done

Space key key code does not exist in USBHIDKeyboard.h #8918

HSBL-ko-gyo opened this issue Nov 25, 2023 · 3 comments
Labels
Status: Awaiting triage Issue is waiting for triage

Comments

@HSBL-ko-gyo
Copy link

Board

all

Device Description

Hardware Configuration

Version

v2.0.14

IDE Name

arduinoIDE

Operating System

all

Flash frequency

all

PSRAM enabled

no

Upload speed

11520

Description

There is no key code corresponding to the space key in USBHIDKeyboard.h. To use the space key, you need to use the ASCII value 32, which is not intuitive. I suggest adding a key code that corresponds to the space key.

For example, you can define:
#define KEY_SPACE 0x20
This change allows you to write code for pressing the space bar just like any other special key:
Keyboard.press(KEY_SPACE);
We would appreciate it if you would consider fixing this issue. Thank you.

Sketch

Keyboard.press(KEY_SPACE);

Debug Message

note: suggested alternative: 'KEY_HOME'

exit status 1

Compilation error: 'KEY_SPACE' was not declared in this scope

Other Steps to Reproduce

No response

I have checked existing issues, online documentation and the Troubleshooting Guide

  • I confirm I have checked existing issues, online documentation and Troubleshooting guide.
@lbernstone
Copy link
Contributor

lbernstone commented Nov 25, 2023

In the future, you are welcome to add something like this yourself. Just navigate to the file in github, and click the pencil icon to edit.

@HSBL-ko-gyo
Copy link
Author

@lbernstone,

Thank you for your response. Although I am still a beginner who is not familiar with using GitHub, I created a pull request regarding the addition of KEY_SPACE. Here is my suggestion: #8921

If there are any mistakes, I would appreciate it if you could point them out. I would like to continue learning and moving forward so that I can contribute to this project.

thank you very much.

@HSBL-ko-gyo
Copy link
Author

@lbernstone,

Thank you for your prompt response. I didn't realize that you were already working on the improvements I was about to suggest. Thank you very much for this wonderful contribution.

We look forward to your continued cooperation in the development of this project. I'm really thankful to you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Awaiting triage Issue is waiting for triage
Projects
None yet
Development

No branches or pull requests

2 participants