ignore lmouse and rmouse lua input when main window isnt focused. it seems unlikely anyone would want these for any other purpose (xmouse and ymouse are based on the emulated window so the clicks should be too)
untested. intended for SF bug 836
This commit is contained in:
parent
14ad02632a
commit
5a1e6c552a
|
@ -2421,6 +2421,11 @@ static int input_get(lua_State *L) {
|
|||
int mask = (i == VK_CAPITAL || i == VK_NUMLOCK || i == VK_SCROLL) ? 0x01 : 0x80;
|
||||
if(keys[i] & mask)
|
||||
{
|
||||
//ignore mouse buttons if the main window isn't focused
|
||||
if(i==1 || i==2)
|
||||
if(GetForegroundWindow()!=hAppWnd)
|
||||
continue;
|
||||
|
||||
const char* name = s_keyToName[i];
|
||||
if(name)
|
||||
{
|
||||
|
@ -2439,6 +2444,12 @@ static int input_get(lua_State *L) {
|
|||
if(name)
|
||||
{
|
||||
int active;
|
||||
|
||||
//ignore mouse buttons if the main window isn't focused
|
||||
if(i==1 || i==2)
|
||||
if(GetForegroundWindow()!=hAppWnd)
|
||||
continue;
|
||||
|
||||
if(i == VK_CAPITAL || i == VK_NUMLOCK || i == VK_SCROLL)
|
||||
active = GetKeyState(i) & 0x01;
|
||||
else
|
||||
|
|
Loading…
Reference in New Issue