From fc76c7fc87a2d2dc09d2c905bb55ec84b3f7f2d4 Mon Sep 17 00:00:00 2001 From: Wanne Date: Mon, 2 Apr 2012 08:56:19 +0000 Subject: [PATCH] - Queue patch (by tazpn) o Cleanup saveload and laptop screen event queue processing git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@5140 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Laptop/laptop.cpp | 26 +------------------------- SaveLoadScreen.cpp | 25 +------------------------ 2 files changed, 2 insertions(+), 49 deletions(-) diff --git a/Laptop/laptop.cpp b/Laptop/laptop.cpp index bee8e43c..7bd78bc2 100644 --- a/Laptop/laptop.cpp +++ b/Laptop/laptop.cpp @@ -714,33 +714,9 @@ GetLaptopKeyboardInput() fTabHandled = FALSE; - while (DequeueEvent(&InputEvent) == TRUE) + while (DequeueSpecificEvent(&InputEvent, KEY_DOWN|KEY_UP|KEY_REPEAT)) { - // HOOK INTO MOUSE HOOKS - switch(InputEvent.usEvent) - { - case LEFT_BUTTON_DOWN: - MouseSystemHook(LEFT_BUTTON_DOWN, (INT16)MousePos.x, (INT16)MousePos.y,_LeftButtonDown, _RightButtonDown); - break; - case LEFT_BUTTON_UP: - MouseSystemHook(LEFT_BUTTON_UP, (INT16)MousePos.x, (INT16)MousePos.y ,_LeftButtonDown, _RightButtonDown); - break; - case RIGHT_BUTTON_DOWN: - MouseSystemHook(RIGHT_BUTTON_DOWN, (INT16)MousePos.x, (INT16)MousePos.y,_LeftButtonDown, _RightButtonDown); - break; - case RIGHT_BUTTON_UP: - MouseSystemHook(RIGHT_BUTTON_UP, (INT16)MousePos.x, (INT16)MousePos.y,_LeftButtonDown, _RightButtonDown); - break; - case RIGHT_BUTTON_REPEAT: - MouseSystemHook(RIGHT_BUTTON_REPEAT, (INT16)MousePos.x, (INT16)MousePos.y,_LeftButtonDown, _RightButtonDown); - break; - case LEFT_BUTTON_REPEAT: - MouseSystemHook(LEFT_BUTTON_REPEAT, (INT16)MousePos.x, (INT16)MousePos.y,_LeftButtonDown, _RightButtonDown); - break; - } - HandleKeyBoardShortCutsForLapTop( InputEvent.usEvent, InputEvent.usParam, InputEvent.usKeyState ); - } } diff --git a/SaveLoadScreen.cpp b/SaveLoadScreen.cpp index 19893949..87a624bb 100644 --- a/SaveLoadScreen.cpp +++ b/SaveLoadScreen.cpp @@ -991,31 +991,8 @@ void GetSaveLoadScreenUserInput() fWasCtrlHeldDownLastFrame = gfKeyState[ CTRL ]; - while( DequeueEvent( &Event ) ) + while (DequeueSpecificEvent(&Event, KEY_DOWN|KEY_UP|KEY_REPEAT)) { - // HOOK INTO MOUSE HOOKS - switch( Event.usEvent) - { - case LEFT_BUTTON_DOWN: - MouseSystemHook(LEFT_BUTTON_DOWN, (INT16)MousePos.x, (INT16)MousePos.y,_LeftButtonDown, _RightButtonDown); - break; - case LEFT_BUTTON_UP: - MouseSystemHook(LEFT_BUTTON_UP, (INT16)MousePos.x, (INT16)MousePos.y ,_LeftButtonDown, _RightButtonDown); - break; - case RIGHT_BUTTON_DOWN: - MouseSystemHook(RIGHT_BUTTON_DOWN, (INT16)MousePos.x, (INT16)MousePos.y,_LeftButtonDown, _RightButtonDown); - break; - case RIGHT_BUTTON_UP: - MouseSystemHook(RIGHT_BUTTON_UP, (INT16)MousePos.x, (INT16)MousePos.y,_LeftButtonDown, _RightButtonDown); - break; - case RIGHT_BUTTON_REPEAT: - MouseSystemHook(RIGHT_BUTTON_REPEAT, (INT16)MousePos.x, (INT16)MousePos.y,_LeftButtonDown, _RightButtonDown); - break; - case LEFT_BUTTON_REPEAT: - MouseSystemHook(LEFT_BUTTON_REPEAT, (INT16)MousePos.x, (INT16)MousePos.y,_LeftButtonDown, _RightButtonDown); - break; - } - if( !HandleTextInput( &Event ) && Event.usEvent == KEY_DOWN ) { switch( Event.usParam )