Hi,
why don't work numeric keyboard in editboxes?
I want input num characters, but it doesn't work.
How I can write with num keyboard?
Thanks very much
Filip
[solved] Numeric keyboard in EditBoxes
Moderators: CEGUI MVP, CEGUI Team
Re: Numeric keyboard in EditBoxes
did you turn on Num Lock on your keyboard?
If somebody helps you by replying to your thread, upvote him/her as a thanks! Make sure to include your CEGUI.log and everything you tried when posting! And remember that we are not magicians!
Re: Numeric keyboard in EditBoxes
Do you think I'm stupid?
Re: Numeric keyboard in EditBoxes
The problem is in OIS. If I press for example key '5' on numeric keyboard OIS return keyEvent.text=0. I had to set text hard.
Code: Select all
bool GIKeyboardListener::keyReleased(const OIS::KeyEvent &arg)
{
unsigned int text = arg.text;
switch (arg.key) {
case OIS::KC_NUMPAD0: text = '0'; break;
case OIS::KC_NUMPAD1: text = '1'; break;
case OIS::KC_NUMPAD2: text = '2'; break;
case OIS::KC_NUMPAD3: text = '3'; break;
case OIS::KC_NUMPAD4: text = '4'; break;
case OIS::KC_NUMPAD5: text = '5'; break;
case OIS::KC_NUMPAD6: text = '6'; break;
case OIS::KC_NUMPAD7: text = '7'; break;
case OIS::KC_NUMPAD8: text = '8'; break;
case OIS::KC_NUMPAD9: text = '9'; break;
case OIS::KC_DECIMAL: text = '.'; break;
}
return m_pGUISystem->injectKeyDown( arg.key ) || m_pGUISystem->injectChar( text );
}
Re: Numeric keyboard in EditBoxes
djphilipe wrote:Do you think I'm stupid?
lol! Sorry I just couldn't resist. I'm glad you got it worked out.
As the Injecting Inputs tutorial mentions, how you obtain the UTF32 value to inject is something that is dependant upon the input library and so is up to you to figure out.
Thanks for posting your solution, I'm sure it will be of use to others using OIS.
If somebody helps you by replying to your thread, upvote him/her as a thanks! Make sure to include your CEGUI.log and everything you tried when posting! And remember that we are not magicians!
Who is online
Users browsing this forum: No registered users and 12 guests