dmamontov / esphome-blekeyboard

ESPHome BLE Keyboard
https://community.home-assistant.io/t/esphome-ble-keyboard/
84 stars 16 forks source link

[BUG] Media buttons don't get released #31

Open Sr-psycho opened 8 months ago

Sr-psycho commented 8 months ago

Describe the bug A clear and concise description of what the bug is.

Please complete the following information:

void Esp32BleKeyboard::press(MediaKeyReport key, bool with_timer) {
  if (this->is_connected()) {
    if (with_timer) {
      this->update_timer();
    }
    bleKeyboard.press(key);
       delay(100);//<--
    bleKeyboard.release(key);//<--
  }
}

Hello Dmitry! Please make this correction, because without it the media buttons remain enabled, even if you write the necessary ble_keyboard.release commands in the config file.

muddyfeet commented 5 months ago

Actually the bug is in the underlying blekeyboard code by T-vK. Have logged an issue on that site: https://github.com/T-vK/ESP32-BLE-Keyboard/issues/289. ReleaseAll does not release the MediaKeys.