arduino-libraries / Keyboard

GNU Lesser General Public License v3.0
223 stars 157 forks source link

F13- F24 keys not working #49

Closed LevitateGamer closed 2 years ago

LevitateGamer commented 3 years ago

It will press f13-f24 but windows will not receive it

edgar-bonet commented 2 years ago

It will press f13-f24

Then it is not an issue with this library. It's an issue with Windows, or with how it is configured to handle (or ignore) those keys.

per1234 commented 2 years ago

Closing as working fine for me. I see there was an issue like this some years ago, but it was fixed by https://github.com/arduino-libraries/Keyboard/pull/10.

I used this thing as an accessible cross-platform way to verify keypresses:

https://codepen.io/QDeltaE/pen/PjXWZr

Test sketch:

#include <Keyboard.h>

const byte enablePin = 2;
const byte LEDPin = LED_BUILTIN;

void setup() {
  pinMode(enablePin, INPUT_PULLUP);
  pinMode(LEDPin, OUTPUT);
  Keyboard.begin();
}

void loop() {
  if (digitalRead(enablePin) == LOW) {
    Keyboard.press(KEY_F16);
    digitalWrite(LEDPin, HIGH);
    delay(500);
    Keyboard.releaseAll();
    digitalWrite(LEDPin, LOW);
    delay(500);
  }
}

"Keyboard Debugger" log:

>Keydown ↓ Key: "F16" KeyCode: 127
>Keyup   ↑ Key: "F16" KeyCode: 127
>Keydown ↓ Key: "F16" KeyCode: 127
>Keyup   ↑ Key: "F16" KeyCode: 127
>Keydown ↓ Key: "F16" KeyCode: 127
>Keyup   ↑ Key: "F16" KeyCode: 127
>Keydown ↓ Key: "F16" KeyCode: 127
>Keyup   ↑ Key: "F16" KeyCode: 127