03-18-2009 09:49 AM
I'm trying to use EventInjector.KeyCodeEvent to simulate a "mute" button press, but I cannot find the keyName for it?
Does anyone know what the keyName for the mute button is? Or what I am trying to accomplish is putting the device into standby mode, is there an easier way to do this?
Thanks in advance for any suggestions!
Solved! Go to Solution.
03-18-2009 11:22 AM
The keycode you want is Keypad.KEY_SPEAKERPHONE. It's labeled in the API as the "speakerphone toggle key," but it actually mutes and unmutes the phone. You can simulate with EventInjector by getting the key portion of the keycode and casting it to a char:
03-18-2009 06:01 PM
Thanks almeida, so should the following be simulating the 'mute' button? It doesn't seem to work for me...
char mute = (char) Keypad.key(Keypad.KEY_SPEAKERPHONE); new EventInjector.KeyCodeEvent(KeyEvent.KEY_DOWN, mute, 0);
03-18-2009 06:04 PM
Close, but you're missing the most important part, which is actually invoking the event:
final char mute = (char) Keypad.key(Keypad.KEY_SPEAKERPHONE);
ent.KEY_DOWN, mute, 0));
06-22-2011 05:46 AM