I need to set selection of an editText box via InputConnection. I used
the SendKeyEvent function with the KEYCODE_DPAD_LEFT and META_SHIFT_ON
state but I've had no luck. My code is as below:

...
// I've already received hardware key event of DPAD left key as event
parameter in this function.

// Change the meta state of event parameter to META_SHIFT_ON
event = new KeyEvent(event.getDownTime(), event.getEventTime(),
                        event.getAction(), event.getKeyCode(), 
event.getRepeatCount(),
KeyEvent.FLAG_SOFT_KEYBOARD|KeyEvent.FLAG_KEEP_TOUCH_MODE|
KeyEvent.META_SHIFT_LEFT_ON|KeyEvent.META_SHIFT_ON,
                        event.getDeviceId(), event.getScanCode());
InputConnection ic = getCurrentInputConnection();
ic.sendKeyEvent(event);

After excuting the code, there still no selection in the EditText.

Could somebody help me to resolve this ?

Thanks in advance.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to