I am trying to handle text box input. I thought I would be able to listen to orxEVENT_TYPE_KEYBOARD and that its payload would contain orxKEYBOARD_EVENT_KEY_PRESSED or orxKEYBOARD_EVENT_KEY_RELEASED.
My event handler never receives the orxEVENT_TYPE_KEYBOARD events. I CAN listen to orxEVENT_TYPE_INPUT and filter it by pressed/released event types.
To do that, I have to create config entries for all the keys I want to receive events for. That's fine, but I was wondering why orxEVENT_TYPE_KEYBOARD never fires. Am I misunderstanding its purpose?
Comments
There isn't a great way to handle text inputs for now, registering inputs for each key is currently probably the safest bet.
I repared the Android build (it was break since Iarwain removed this event). This event was used by the keyboard android plugin.
Acksys: If you want to intercept the "back" key of an android device, you can map an input to the KEY_ESCAPE key.
Just an example, in my game, I use that :
So, in my case, by pressing the back android key, pause is activated.
Others keys can be intercepted, if you want to know which one and how, you can take a look at the file in orx/code/plugins/Keyboard/android/orxKeyboard.cpp : orxKeyboard_Android_GetNVKey() or orxKeyboard_Android_GetKey().
All NV_KEYCODE_XXX correpond to the input managed by the NVEvent library (and so, the android event)
Both have been implemented in the GLFW plugin for now and will probably make it to Android at some point. Don't expect any SDL/SFML implementation though as those plugins are getting really obsolete anyway.