diff --git a/REDALERT/GADGET.CPP b/REDALERT/GADGET.CPP index 01b2ec9..1f2db0e 100644 --- a/REDALERT/GADGET.CPP +++ b/REDALERT/GADGET.CPP @@ -86,7 +86,6 @@ RemapControlType * GadgetClass::ColorScheme = &_GreyScheme; int mousex, mousey; - /*********************************************************************************************** * GadgetClass::GadgetClass -- Constructor for gadget object. * * * @@ -535,11 +534,14 @@ KeyNumType GadgetClass::Input(void) ** rather the the mouse position at the time we get around to this function. */ // jmarshall - static int flags = 0; + int flags = 0; SDL_GetMouseState(&mousex, &mousey); - if (flags == LEFTRELEASE || flags == RIGHTRELEASE) - flags = 0; + Keyboard->MouseQX = mousex; + Keyboard->MouseQY = mousey; + +// if (flags == LEFTRELEASE || flags == RIGHTRELEASE) +// flags = 0; SDL_Event event; while (SDL_PollEvent(&event)) { @@ -550,12 +552,19 @@ KeyNumType GadgetClass::Input(void) flags = LEFTPRESS; key = KN_LMOUSE; } + else if (event.button.button == SDL_BUTTON_RIGHT) { + flags = RIGHTPRESS; + key = KN_LMOUSE; + } break; case SDL_MOUSEBUTTONUP: if (event.button.button == SDL_BUTTON_LEFT) { flags = LEFTRELEASE; } + else if (event.button.button == SDL_BUTTON_RIGHT) { + flags = RIGHTRELEASE; + } break; } } diff --git a/REDALERT/WIN32LIB/KEYBOARD.H b/REDALERT/WIN32LIB/KEYBOARD.H index 8233bc4..38f7241 100644 --- a/REDALERT/WIN32LIB/KEYBOARD.H +++ b/REDALERT/WIN32LIB/KEYBOARD.H @@ -89,8 +89,8 @@ class WWKeyboardClass /* Define the public access variables which are used with the */ /* Keyboard Class. */ /*===================================================================*/ - int MouseQX; - int MouseQY; + //int MouseQX; + //int MouseQY; unsigned char VKRemap[256]; // gives vk for any ascii char private: