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


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

and the whole Java class is at ... 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?


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

(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...
Posts: 2
Joined: Mon Mar 07, 2011 6:44 pm


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.
Thanks with Regards,
Raj - The Kernel
Master Developer
Master Developer
Posts: 311
Joined: Tue Feb 15, 2011 7:40 am
Location: The Capital of India,


Return to Other Coding-Problems

Who is online

Users browsing this forum: Exabot [Bot], Google [Bot], MSNbot Media and 24 guests