I am trying to send keyevent commands from my Leonardo to my Android tablet, part of a head unit. I can send the commands via ADB shell on my laptop, but I cannot figure out how to send them via the arduino.
I have been looking for weeks on how to do this, I have gotten some close hits (http://www.instructables.com/id/USB-Ped … -Leonardo/) but they are in the area of sending the standard ASCII keyboard codes, and I am looking to send screen diming/brighten and sleep/wake.
Thank you. Yes, I have looked into the ADK board but my impression was that it worked well for cases where you were trying to control an Arduino via the Android. I chose Leonardo since it appears as a HID to the Android, so I thought I could send keyevents to the Android. Correct me if I am wrong.
Thanks for the info. I am a little confused as to how I emulate a keypress (for brightness and wake/sleep) via the ADK, I read through the doc at the link but I am not getting a picture as to how to do it. Do have any guidance?
I’m not familiar with how to do these things, but I’m pretty sure that keypress emulation isn’t the way to do it. You’ll need to explore the ADK library code and documentation to find the function calls you need to do what you want.