How to get an event for soft keyboard KEYCODE_DEL?

Put your problem here if it does not fit any of the other categories.

How to get an event for soft keyboard KEYCODE_DEL?

Postby DMG » Mon Mar 07, 2011 6:54 pm

Hi,

I asked this on the Android dev mailing list, and on stackoverflow; nobody answered.

Asking here...

In my application, I bring the soft keyboard on from time to time, and
it looks like events for the DEL key are not delivered. The method in
question is at

http://pastebin.com/zZaZWJ4t

and the whole Java class is at

http://squeakvm-tablet.googlecode.com/h ... ak/andro...

Any alphanumeric key or Enter (Return) tapped on the soft keyboard is
passed to the application except for KEYCODE_DEL. I tried to replace
KEYCODE_DEL in the case clause with anything else (e. g. with code for
for hardware button PAGE_UP), and the clause takes control when that
button is pressed.

I did not subclass the Android Keyboard class, just used the default
input manager.

What can be done in order to receive events for KEYCODE_DEL? Is
deriving a subclass the only way?


Thanks.

PS After doing some research, I found that e. g. LatinIME implementation found under

http://android.git.kernel.org/?p=platfo ... inIME.java

(see the handleBackspace function ca. line 1282) uses rather contrived logic to handle certain keys, attempting to do some edit on its own, while all I need is to pass all keycodes to the app.

If this is the case with default Android soft kbd implementation then perhaps I need to subclass my own soft kbd...
DMG
Freshman
Freshman
 
Posts: 2
Joined: Mon Mar 07, 2011 6:44 pm

Top

Re: How to get an event for soft keyboard KEYCODE_DEL?

Postby raj_J2ME » Tue Mar 08, 2011 7:16 am

I think that this is the only solution. Please check this URL too, explaining the same thing.
http://developer.android.com/resources/samples/SoftKeyboard/src/com/example/android/softkeyboard/SoftKeyboard.html
Thanks with Regards,
Raj - The Kernel
raj_J2ME
Master Developer
Master Developer
 
Posts: 311
Joined: Tue Feb 15, 2011 7:40 am
Location: The Capital of India,

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: Google [Bot] and 22 guests