Alt key pausing an application

BlitzMax Forums/MaxGUI Module/Alt key pausing an application

Jur(Posted 2012) [#1]
Pressing the left alt key triggers the menu and pauses an application.
Depending on the application this can be quite an undesired behavior. In my graphic application I need the alt key for my use.
This problem was discussed before ( http://www.blitzbasic.com/Community/posts.php?topic=63230 ).

I wonder has anybody found a solution for this?


*(Posted 2012) [#2]
Taking into account that alt is used by the windows system I would choose another key, some users wouldnt like a app that messes with the windows defined keys. IIRC BlitzSupport many years ago posted code to disable alt-tab using that sort of system is about as popular as a chocolate teapot.


Jur(Posted 2013) [#3]
I found a solution, but it needs a slight modification to maxGUI.

In file win32maxguiex.bmx, type TWindowsGadget, method WndProc(hwnd,msg,wp,lp), add this line at the top of the method:

If msg=WM_SYSCOMMAND And wp=$F100 And lp=0 Then Return 0


This will modify windows behavior and focus will not switch to the menu for the situation when only Alt is pressed (and no other key). Situations when the Alt key is pressed with another key (Alt+Tab etc.) still provide expected behavior.