I’m making a game using AndEngine which uses the soft keyboard of the device.
I’m NOT using EditText, but rather my own. I’m trying to detect presses on the soft keyboard,
I’ve already succeeded in showing and hiding the keyboard over the AndEngine scene.
My activity implements the OnKeyboardActionListener, which I read is used as a soft-keyboard listener, but I’m not sure how to register the keyboard with this class (the activity).
Obviously, at the moment, the code inside onPress() is useless..
I couldn’t find any examples, most of them refers to EditText, which I’m not using..
Is it possible?
Maybe a service or something?
Thanks in advance.
EDIT:
I’m trying to create my own keyboard using KeyboardView and a custom Keyboard,
This way I could do
KeyboardView kbView = new KeyboardView(this,null);
kbView.setKeyboard(new Keyboard(this, R.xml.keyboard);
kbView.setOnKeyboardActionListener(new OnKeyboardActionListener() {
....
}
Has anyone done this? works, doesn’t?
Thanks.
I ended up creating my own
KeyboardandKeyboardView`, then I used this codeAnd created a
KeyboardViewin the xml layoutCustomKeyboardViewonly extendsKeyboardView, dunno why, but it works with the custom and not with the originalEDIT:
Also, The activity extends
SimpleLayoutGameActivity, And then I selected the layout which contains theCustomKeyboardView