lemmingDev/ESP32-BLE-Gamepad

android TVKeys are recognized differently on Android-based TVs.

Closed this issue · 1 comments

I'm trying to use the gamepad function to control an Android-based TV with a web server. (An app called Button Mapper recognized the keyevent of the Android TV remote control I use as a gamepad-related key.)

So, I searched for the service button on the remote control and found it was BUTTON_1.

However, when I run bleGamepad.press(BUTTON_1); of gamepad, it is set to BUTTON_A.

Did I use the code incorrectly?

Thank you for your hard work.

==========================================================
#include <Arduino.h>
#include <BleGamepad.h>

BleGamepad bleGamepad;

void setup()
{
Serial.begin(115200);
Serial.println("Starting BLE work!");
bleGamepad.begin();
Serial.println("Waiting 10s...");
delay(10000);
}

void loop()
{
if (bleGamepad.isConnected())
{
Serial.println("Press button BUTTON_1 start.");
bleGamepad.press(BUTTON_1);
bleGamepad.pressStart();
delay(500);

    Serial.println("Release button BUTTON_1 start.");
    bleGamepad.release(BUTTON_1);
    bleGamepad.releaseStart();
    delay(500);
}

}

An indirect cause was found.

This appears to be the key value set on an Android-based TV.

When you connect the remote control to Android, UNKOWN(0) appears.