T-vK / ESP32-BLE-Keyboard

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

Can work on my iPhone but cannot work on my laptop win 10 #276

Open Folnia opened 6 months ago

Folnia commented 6 months ago

On the laptop it shows they are paired and connected, but nothing happend...nothing was typed in the text I opened. But it worked with my iphone.

One stange thing: I used an BLE assitant on win 10 (BLECOMM) and used the pairing fuction , then it worked.

ESP32-WROOM-32D ESP32-BLE-KEYBOARD 0.3.2

#include <Arduino.h>
#include <BleKeyboard.h>

#include <wifi.h>
//#define USE_NIMBLE

BleKeyboard myKeyboard("我的ESP32board","Espressif",100);

void setup() {
  // put your setup code here, to run once:
Serial.begin(115200);
myKeyboard.begin();

}

void loop() {

  if (myKeyboard.isConnected())
    {       
    myKeyboard.print("hello"); 
    delay(3000);    
    //myKeyboard.press(KEY_NUM_ENTER);
    //delay(1000);
    myKeyboard.releaseAll();
    Serial.println("pressed");    
    }

}