a.andreev Posted February 25, 2014 Share Posted February 25, 2014 Hello! We have a question about keyboard callbacks. When some key was pressed and released during we hold pressed some other key - callback for the held key is ignored. In fact, callback for that key begins skipped after we press another one, that's OK, but it's keep skipped when we already release interrupting key. How can we fix that? Thanks in advance! Link to comment
unclebob Posted February 25, 2014 Share Posted February 25, 2014 Hello Alexey, Are you using engine.controls.setKeyPressCallback or engine.gui.setKeyPressCallback? It'd be nice to have your test scene. Link to comment
a.andreev Posted February 26, 2014 Author Share Posted February 26, 2014 Thank you! We have trying both: controls and gui. Here the test scene. Use any key. test_key_callback.rar Link to comment
unclebob Posted March 3, 2014 Share Posted March 3, 2014 Hi again, Unigine will run callbacks as it receives messages from the OS so, for example, on Windows it'll forward key codes from WM_KEYDOWN and WM_SYSKEYDOWN messages to your key_press callback. As it's OS behaviour there's no need to fix that. By the way, it's better to use engine.app.getKeyState and engine.app.clearKeyState for input handling. Link to comment
Recommended Posts