More info on device code
OK, here is a brief explanation of what I am trying to do. I want to inject an event into the system with EventInjector.invokeEvent(). That call needs an object that is derived from EventInjector.Event. I do not, however, want this to be a Trackwheel or Key event.
So, I have a class that derives from EventInjector.Event. On my first compile after deriving, I got the message that I had not called the superclass constructor which looks like this: super(int, int, int, int, int, Object, Object).
After making the debugger stop at various points and passing arguments in different orders, I determined that the superclass constructor would look like this (if it were documented):
EventInjector.Event(int deviceCode, int eventId, int submessage, int data0, int data1, Object object0, Object object1);
This looked familiar to me as the last four parameters are what ApplicationManager.postGlobalEvent() uses in certain of its forms. After playing with the debugger some more, I was able to determine that the simulator seems to pass 0x23 as the device code all the time. I do not think I can count on this on a real device, however, and thus the question as to where to get the device code for the handheld.
I suspect I might be able to get ApplicationManager.postGlobalEvent() to do this for me, but I cannot seem to find the right GUID value to pass.
|