mirror of
https://github.com/jmarshall23/CnC_Remastered_Collection.git
synced 2026-08-12 08:00:55 +02:00
Fixed error in mouse key processing, mouse right click works, mouseQX/QY updated.
This commit is contained in:
+13
-4
@@ -86,7 +86,6 @@ RemapControlType * GadgetClass::ColorScheme = &_GreyScheme;
|
|||||||
|
|
||||||
int mousex, mousey;
|
int mousex, mousey;
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************************************
|
/***********************************************************************************************
|
||||||
* GadgetClass::GadgetClass -- Constructor for gadget object. *
|
* 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.
|
** rather the the mouse position at the time we get around to this function.
|
||||||
*/
|
*/
|
||||||
// jmarshall
|
// jmarshall
|
||||||
static int flags = 0;
|
int flags = 0;
|
||||||
SDL_GetMouseState(&mousex, &mousey);
|
SDL_GetMouseState(&mousex, &mousey);
|
||||||
|
|
||||||
if (flags == LEFTRELEASE || flags == RIGHTRELEASE)
|
Keyboard->MouseQX = mousex;
|
||||||
flags = 0;
|
Keyboard->MouseQY = mousey;
|
||||||
|
|
||||||
|
// if (flags == LEFTRELEASE || flags == RIGHTRELEASE)
|
||||||
|
// flags = 0;
|
||||||
|
|
||||||
SDL_Event event;
|
SDL_Event event;
|
||||||
while (SDL_PollEvent(&event)) {
|
while (SDL_PollEvent(&event)) {
|
||||||
@@ -550,12 +552,19 @@ KeyNumType GadgetClass::Input(void)
|
|||||||
flags = LEFTPRESS;
|
flags = LEFTPRESS;
|
||||||
key = KN_LMOUSE;
|
key = KN_LMOUSE;
|
||||||
}
|
}
|
||||||
|
else if (event.button.button == SDL_BUTTON_RIGHT) {
|
||||||
|
flags = RIGHTPRESS;
|
||||||
|
key = KN_LMOUSE;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SDL_MOUSEBUTTONUP:
|
case SDL_MOUSEBUTTONUP:
|
||||||
if (event.button.button == SDL_BUTTON_LEFT) {
|
if (event.button.button == SDL_BUTTON_LEFT) {
|
||||||
flags = LEFTRELEASE;
|
flags = LEFTRELEASE;
|
||||||
}
|
}
|
||||||
|
else if (event.button.button == SDL_BUTTON_RIGHT) {
|
||||||
|
flags = RIGHTRELEASE;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -89,8 +89,8 @@ class WWKeyboardClass
|
|||||||
/* Define the public access variables which are used with the */
|
/* Define the public access variables which are used with the */
|
||||||
/* Keyboard Class. */
|
/* Keyboard Class. */
|
||||||
/*===================================================================*/
|
/*===================================================================*/
|
||||||
int MouseQX;
|
//int MouseQX;
|
||||||
int MouseQY;
|
//int MouseQY;
|
||||||
|
|
||||||
unsigned char VKRemap[256]; // gives vk for any ascii char
|
unsigned char VKRemap[256]; // gives vk for any ascii char
|
||||||
private:
|
private:
|
||||||
|
|||||||
Reference in New Issue
Block a user