Re: [AD] [ alleg-Bugs-1263730 ] key_shifts does not work with win95/98/me

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


On Fri, 2005-08-26 at 23:47 +0200, Evert Glebbeek wrote:
> Sorry for doing so little over the past few days and bringing up a reminder 
> on the eve of going abroad for a week, but I'd like to ask if anyone has 
> been able to look into this?
> If not, I might be able to after I return on friday provided I don't have a 
> big jetlag.
> 

Hm, this was already assigned to me previously, but I postponed it until
I would have access to Windows the next time.. which never happened.

Anyway, attached is a really trivial patch which should fix it, but it
is completely untested. So, someone with win98 should now verify that
key_shifts works correctly with it (e.g. in exkeys), and someone with XP
that it still works there as well.

-- 
Elias Pschernig
Index: src/win/wkeybd.c
===================================================================
RCS file: /cvsroot/alleg/allegro/src/win/wkeybd.c,v
retrieving revision 1.34
diff -u -p -r1.34 wkeybd.c
--- src/win/wkeybd.c	14 May 2005 15:54:52 -0000	1.34
+++ src/win/wkeybd.c	26 Aug 2005 22:07:40 -0000
@@ -161,11 +161,11 @@ static void update_shifts(BYTE * keystat
    /* Can't we just deprecate key_shifts, now that pckeys.c is gone? EP */
    unsigned int modifiers = 0;
 
-   if ((keystate[VK_LSHIFT] & 0x80) || (keystate[VK_RSHIFT] & 0x80))
+   if (keystate[VK_SHIFT] & 0x80)
       modifiers |= KB_SHIFT_FLAG;
-   if ((keystate[VK_LCONTROL] & 0x80) || (keystate[VK_RCONTROL] & 0x80))
+   if (keystate[VK_CONTROL] & 0x80)
       modifiers |= KB_CTRL_FLAG;
-   if (keystate[VK_LMENU] & 0x80 || keystate[VK_RMENU] & 0x80)
+   if (keystate[VK_MENU] & 0x80)
       modifiers |= KB_ALT_FLAG;
    if (keystate[VK_SCROLL] & 1)
       modifiers |= KB_SCROLOCK_FLAG;


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