• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Virtual Keyboard

deekjx

Member
Jul 7, 2009
75
20
Hello All,

I'm new to these forums as well as new to coding on the android platform. After a several hours of research, I'm still unable to process the period entry made on the virtual keyboard. Does any one have a small code snippet or example explaining this?

I can easily take the input from the real keyboard. After testing the early parts of my app, friend noticed that it didn't recognize the "." key when entering an IP address. What's funny is that it does recognize the numbers typed on the virtual keyboard. I have the following event handler:

oct2.setOnKeyListener(new OnKeyListener() {
public boolean onKey(View v, int keyCode, KeyEvent event) {
if ((event.getAction() == KeyEvent.ACTION_DOWN) && (keyCode == KeyEvent.KEYCODE_PERIOD)) {
// Perform action on key press
oct3.requestFocus();
return true;
}
return false;
}
});

Most of this comes from the tutorial. I've found that there is a different listener for the virtual keyboard and have imported "android.inputmethodservice.KeyboardView.OnKeyboardActionListener" but I still can not get it to work.

Any help that can be provided will be greatly appreciated.


Deekjx
 

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones