Monday, March 23, 2009

Code : End incoming call programatically

Code Event injector will work only when the keystrokeinjection permission is set to allow for that particular application. To do so you have to go to the Options -> Advanced Options -> Applications –> Press Menu key –>  Modules –> select your application –> Press Menu key –> Edit Permissions –> Expand Interaction option-> set to allow keystrokeinjection permission.

EventInjector.KeyCodeEvent pressEndKey = new
    EventInjector.KeyCodeEvent(
    KeyCodeEvent.KEY_DOWN,( char)
    Keypad.KEY_END,0,100);

EventInjector.KeyCodeEvent releaseEndKey =
    new EventInjector.KeyCodeEvent(
    KeyCodeEvent.KEY_UP,(char)
    Keypad.KEY_END,0,100);

Thread.sleep(1000);
EventInjector.invokeEvent(pressEndKey);
EventInjector.invokeEvent(releaseEndKey);

2 comments:

Place your comments here...