Search code examples
javaandroidbluetoothhid

Escape sequence for Keyboard Down Arrow


I have an Android JAVA app that connects to a USB Bluetooth keyboard emulator that I bought from here http://intelletto.com/products

So far I'm able to send Escape sequences like \t, \n but I'm not sure how to send a command for the Key Down event. Here's how I'm doing it:

char str = '\t';
byte[] command = String.valueOf(str).getBytes();
mBTService.write(command);

Also, I got this HID ASCII Mapping table from the USB provider which I'm not sure how to use it.

https://drive.google.com/file/d/1hZV5mdaPCN93BK6bYZeX2h9y5lx3R2hS/view?usp=sharing


Solution

  • According with the map chart you posted, it must be surely like this:

    byte[] command = new byte[]{(byte)201};
    mBTService.write(command);
    

    ... as 201 is the code for "DownArr" (in this specific mapping, altough that is not a standard codification).