Page 1 of 1

Function keys F10 & F12

Posted: Mon May 13, 2019 9:01 am
by Ats
I'm using the function keys F1 to F12 in order to debug Omeganaut, but I've stumble on two problems with that:
  • F10 key (code 121) seems to do nothing
  • F12 key (code 123) is equal to a left mouse click
Is that something related to CharCode or ZGE is using those numbers for internal things?
There no info about that on the wiki: http://zgameeditor.org/index.php/ComponentRef/KeyPress

Thanks :)

Re: Function keys F10 & F12

Posted: Mon May 13, 2019 9:55 am
by Kjell
Hi Ats,
Ats wrote: Mon May 13, 2019 9:01 amF10 key (code 121) seems to do nothing
F10 is a bit of a special case in Windows. It's possible to get it to work, but you need a bit of a workaround .. here's a snippet from MSDN ( for Ville ).

If the F10 key is pressed, the DefWindowProc function sets an internal flag. When DefWindowProc receives the WM_KEYUP message, the function checks whether the internal flag is set and, if so, sends a WM_SYSCOMMAND message to the top-level window. The WM_SYSCOMMAND parameter of the message is set to SC_KEYMENU.
Ats wrote: Mon May 13, 2019 9:01 amF12 key (code 123) is equal to a left mouse click
The 3 mouse buttons override F12, F13 and F14 because "{", "|" and "}" are mapped to the same key-codes by the ASCII standard.

K

Re: Function keys F10 & F12

Posted: Tue May 14, 2019 9:46 am
by Ats
Thanks for the explanations Kjell, that's good to know, and should be written down in the ZGE wiki :D
I'm going to move my debug keys from the function keys to the number keys then.