QB64.org Forum
QB64 Team Software => InForm Discussion => Topic started by: davidshq on July 06, 2019, 12:09:23 am
-
I'm thinking of a game for toddlers. Thing is toddlers tend to bang on the keyboard a bit and this oftentimes results in unwanted things occurring - for example, they might close out the open program, resize the window, open another program, etc. I'm wondering if there is a simple way to force the form to be the focus and only allow exiting using a keystroke combination (e.g. Ctrl+Alt+E) - this would keep the program present but also allow parents to exit the app when desired. Thoughts?
-
HI
IMHO it is not possible in QB64 if you don't use calling to Windows API
see here from the Wiki
FOCUS http://qb64.org/wiki/Windows_Libraries#Focus (http://qb64.org/wiki/Windows_Libraries#Focus)
Mouse AREA http://qb64.org/wiki/Windows_Libraries#Mouse_Area (http://qb64.org/wiki/Windows_Libraries#Mouse_Area)
SendKeys http://qb64.org/wiki/Windows_Libraries#Send_Keys (http://qb64.org/wiki/Windows_Libraries#Send_Keys)
Losing Focus http://qb64.org/wiki/Windows_Libraries#Window_Focus (http://qb64.org/wiki/Windows_Libraries#Window_Focus)
I hope this can be useful for you.
Good Coding