T-vK / ESP32-BLE-Keyboard

Bluetooth LE Keyboard library for the ESP32 (Arduino IDE compatible)
2.27k stars 378 forks source link

works on windows 10 and android but not on windows 11 #286

Closed alonchen410 closed 3 months ago

alonchen410 commented 3 months ago

hi im trying to make a macro pad(my first project) and decided to use this library but for some reason when i connect it to a windows 10 laptop or to an android phone it works but if i try to connect it to a windows 11 laptop it doesnt work any ideas on what happened and how to fix this?, thanks

my simple code for testing:

#include <BleKeyboard.h>

BleKeyboard bleKeyboard;

void setup() {
  Serial.begin(115200);
  bleKeyboard.begin();
  pinMode(8, OUTPUT);
  pinMode(0, INPUT_PULLUP);
  pinMode(1, INPUT_PULLUP);
  pinMode(3, INPUT_PULLUP);
  pinMode(4, INPUT_PULLUP);
  pinMode(5, INPUT_PULLUP);
  pinMode(6, INPUT_PULLUP);
  pinMode(7, INPUT_PULLUP);
  pinMode(10, INPUT_PULLUP);
  pinMode(20, INPUT_PULLUP);
  digitalWrite(8, HIGH)
}

void loop() {
  if (digitalRead(0) == LOW || digitalRead(1) == LOW || digitalRead(3) == LOW || digitalRead(4) == LOW || digitalRead(5) == LOW || digitalRead(6) == LOW || digitalRead(7) == LOW || digitalRead(10) == LOW || digitalRead(20) == LOW){
    digitalWrite(8, LOW);
    bleKeyboard.write('d');
    delay(1000);
    digitalWrite(8, HIGH);
  }
}