Jump to content

[SOLVED] Keyboard callback ignored.


photo

Recommended Posts

Posted
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!

Posted

Hello Alexey,

 

Are you using engine.controls.setKeyPressCallback or engine.gui.setKeyPressCallback? It'd be nice to have your test scene.

Posted

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.

×
×
  • Create New...