Skip to content

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

Closed
@HSBL-ko-gyo

Description

@HSBL-ko-gyo

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions