Jump to content
Sign in to follow this  
zapat

Get keypress in a dialog

Recommended Posts

Edit: Why does one have to struggle with a problem for 2 hours, post a help me thread, and find the solution 10 seconds later? :)

Which is of course: ctrlSetFocus

------------------------------------------------------

I have a settings dialog. What I would like to do is to have a field which can receive a key after the user clicks on it. (to remap a mission specific key)

Now I have the following problems getting the key:

If I use displayAddEventHandler ["KeyDown",... the TAB key is not received (it would be important though) since the dialog reserves it for itself.

And for some reason I can't get any controls to receive KeyDown EH. The click may steals focus? I use an ActiveText type for that and it just can't receive KeyDown EH (I couldn't make it work)

I can accept that I won't be able to receive ESC keypress in a dialog, but I should be able to get the rest.

Should I close the dialog, receive the keypress, and reopen the dialog? Seems to be gunge...

Thanks in advance

Edited by zapat

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×