Re: [AD] filtering out OS key handling

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On Mon, Aug 17, 2009 at 10:12 PM, Matthew Leverton<meffer@xxxxxxxxxx> wrote:
> There needs to be a way to optionally filter out the OS handling of
> keys in A5. For instance, in Windows in a windowed mode, the following
> happens:
>
Given the lack of interest, attached is a patch that simply prevents
Windows from intercepting the ALT key for use with system menus. For
99.99% of Allegro programs this would be the desired behavior.

Any other system sequence involving ALT will continue to function as
normal (ALT-Tab, ALT-F4, etc).


--
Matthew Leverton
Index: 4.9/src/win/wnewwin.c
===================================================================
--- 4.9/src/win/wnewwin.c	(revision 12508)
+++ 4.9/src/win/wnewwin.c	(working copy)
@@ -498,6 +498,11 @@
                ((wParam & 0xfff0) == SC_MONITORPOWER || (wParam & 0xfff0) == SC_SCREENSAVE)) {
             return 0;
          }
+         else if ((wParam & 0xfff0) == SC_KEYMENU) {
+            /* Prevent Windows from intercepting the ALT key.
+               (Disables opening menus via the ALT key.) */
+            return 0;
+         }
          break;
       }
       case WM_PAINT: {


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/