I've been working on an Android powered fitness bike for a while now, to basically pull the workout information generated by the bike in realtime, to use it with other applications running in a remote PC.
The problem I'm facing now, is that I need to trigger specific key stokes in the Android system programatically, but I'm having trouble reading the Key Codes of some hard buttons of the console in the first place, as they apparently don´t leave any trace in the Android OS.
So far, I tried with Android KeyEvent Display App to see if there was any trace of a keycode after pressing these buttons. The results were negative.
NOTE: The weird thing is that there are a "Menu" and "Back" hard buttons implemented in the bike console that actually leave a trace (Code 82 + ScanCode 229 for NAV_BACK, and Code 4 + ScanCode 158 for NAV_MENU)...so, for some reason the "other" special buttons are treated differently by the OS (BTW, these buttons are used to increase the resistance of the bike while riding). ...as if they would only work when the main workout application is running...the same thing happens with volume buttons, which is even more strange, as they are standard implementation in almost every Android phone.
Good news is that the fitness app included in the console, has a maintenance function that tells you the actual KeyCodes (that's how they are called) of the console when you press them, but in that application, all the console keys produce a different output than in the Android KeyEvent app. For example:
NAV_BACK = 101 NAV_MENU = 100 INCREASE_POWER = 6 DECREASE_POWER = 5
...and also none of those codes seem to work or do anything visible, when used with input and/or sendevent commands.
So, in summary:
a) I was wondering if there was another "lower level" or alternative way to intercept these key strokes that I might be missing...I already tried to "tail" the Serial 0 and Serial 1 ports, but once again, they only showed activity when the Menu and Back buttons were hit (and the codes are the same as the ones I see with the Android KeyEvent app).
b) and...is it possible that half of the keyboard is connected via serial and the other half is not? How are those other keys connected then?
Thanks a lot in advance. Dan.