Meta keys combinations fix (win32)
This commit is contained in:
parent
a00ce315b8
commit
8e6d99a1ac
|
@ -222,7 +222,8 @@ uint32 GetGamepadPressedImmediate()
|
||||||
// e.g. do not trigger "F1" if "Ctrl+F1" is pressed
|
// e.g. do not trigger "F1" if "Ctrl+F1" is pressed
|
||||||
int DTestButton(ButtConfig *bc, uint8_t just_down, uint8_t block_meta)
|
int DTestButton(ButtConfig *bc, uint8_t just_down, uint8_t block_meta)
|
||||||
{
|
{
|
||||||
static unsigned int *keys_data = !just_down ? GetKeyboard_nr() : GetKeyboard_jd();
|
unsigned int *keys_data = !just_down ? GetKeyboard_nr() : GetKeyboard_jd();
|
||||||
|
unsigned int *keys_data_nr = GetKeyboard_nr();
|
||||||
|
|
||||||
for (int x = 0; x < bc->NumC; x++)
|
for (int x = 0; x < bc->NumC; x++)
|
||||||
{
|
{
|
||||||
|
@ -231,45 +232,45 @@ int DTestButton(ButtConfig *bc, uint8_t just_down, uint8_t block_meta)
|
||||||
int cmd = bc->ButtonNum[x];
|
int cmd = bc->ButtonNum[x];
|
||||||
int cmdmask = cmd&CMD_KEY_MASK;
|
int cmdmask = cmd&CMD_KEY_MASK;
|
||||||
|
|
||||||
/* test CTRL, SHIFT, ALT */
|
/* test CTRL, SHIFT, ALT, WIN */
|
||||||
if (cmd & CMD_KEY_ALT)
|
if (cmd & CMD_KEY_ALT)
|
||||||
{
|
{
|
||||||
int ctlstate = (cmd & CMD_KEY_LALT) ? keys_data[SCAN_LEFTALT] : 0;
|
int ctlstate = (cmd & CMD_KEY_LALT) ? keys_data_nr[SCAN_LEFTALT] : 0;
|
||||||
ctlstate |= (cmd & CMD_KEY_RALT) ? keys_data[SCAN_RIGHTALT] : 0;
|
ctlstate |= (cmd & CMD_KEY_RALT) ? keys_data_nr[SCAN_RIGHTALT] : 0;
|
||||||
if (!ctlstate)
|
if (!ctlstate)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
else if (block_meta && ((cmdmask != SCAN_LEFTALT && keys_data[SCAN_LEFTALT]) || (cmdmask != SCAN_RIGHTALT && keys_data[SCAN_RIGHTALT])))
|
else if (block_meta && ((cmdmask != SCAN_LEFTALT && keys_data_nr[SCAN_LEFTALT]) || (cmdmask != SCAN_RIGHTALT && keys_data_nr[SCAN_RIGHTALT])))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (cmd & CMD_KEY_CTRL)
|
if (cmd & CMD_KEY_CTRL)
|
||||||
{
|
{
|
||||||
int ctlstate = (cmd & CMD_KEY_LCTRL) ? keys_data[SCAN_LEFTCONTROL] : 0;
|
int ctlstate = (cmd & CMD_KEY_LCTRL) ? keys_data_nr[SCAN_LEFTCONTROL] : 0;
|
||||||
ctlstate |= (cmd & CMD_KEY_RCTRL) ? keys_data[SCAN_RIGHTCONTROL] : 0;
|
ctlstate |= (cmd & CMD_KEY_RCTRL) ? keys_data_nr[SCAN_RIGHTCONTROL] : 0;
|
||||||
if (!ctlstate)
|
if (!ctlstate)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
else if (block_meta && ((cmdmask != SCAN_LEFTCONTROL && keys_data[SCAN_LEFTCONTROL]) || (cmdmask != SCAN_RIGHTCONTROL && keys_data[SCAN_RIGHTCONTROL])))
|
else if (block_meta && ((cmdmask != SCAN_LEFTCONTROL && keys_data_nr[SCAN_LEFTCONTROL]) || (cmdmask != SCAN_RIGHTCONTROL && keys_data_nr[SCAN_RIGHTCONTROL])))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (cmd & CMD_KEY_SHIFT)
|
if (cmd & CMD_KEY_SHIFT)
|
||||||
{
|
{
|
||||||
int ctlstate = (cmd & CMD_KEY_LSHIFT) ? keys_data[SCAN_LEFTSHIFT] : 0;
|
int ctlstate = (cmd & CMD_KEY_LSHIFT) ? keys_data_nr[SCAN_LEFTSHIFT] : 0;
|
||||||
ctlstate |= (cmd & CMD_KEY_RSHIFT) ? keys_data[SCAN_RIGHTSHIFT] : 0;
|
ctlstate |= (cmd & CMD_KEY_RSHIFT) ? keys_data_nr[SCAN_RIGHTSHIFT] : 0;
|
||||||
if (!ctlstate)
|
if (!ctlstate)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
else if (block_meta && ((cmdmask != SCAN_LEFTSHIFT && keys_data[SCAN_LEFTSHIFT]) || (cmdmask != SCAN_RIGHTSHIFT && keys_data[SCAN_RIGHTSHIFT])))
|
else if (block_meta && ((cmdmask != SCAN_LEFTSHIFT && keys_data_nr[SCAN_LEFTSHIFT]) || (cmdmask != SCAN_RIGHTSHIFT && keys_data_nr[SCAN_RIGHTSHIFT])))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (cmd & CMD_KEY_WIN)
|
if (cmd & CMD_KEY_WIN)
|
||||||
{
|
{
|
||||||
int ctlstate = (cmd & CMD_KEY_LWIN) ? keys_data[SCAN_LEFTWIN] : 0;
|
int ctlstate = (cmd & CMD_KEY_LWIN) ? keys_data_nr[SCAN_LEFTWIN] : 0;
|
||||||
ctlstate |= (cmd & CMD_KEY_RWIN) ? keys_data[SCAN_RIGHTWIN] : 0;
|
ctlstate |= (cmd & CMD_KEY_RWIN) ? keys_data_nr[SCAN_RIGHTWIN] : 0;
|
||||||
if (!ctlstate)
|
if (!ctlstate)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
else if (block_meta && ((cmdmask != SCAN_LEFTWIN && keys_data[SCAN_LEFTWIN]) || (cmdmask != SCAN_RIGHTWIN && keys_data[SCAN_RIGHTWIN])))
|
else if (block_meta && ((cmdmask != SCAN_LEFTWIN && keys_data_nr[SCAN_LEFTWIN]) || (cmdmask != SCAN_RIGHTWIN && keys_data_nr[SCAN_RIGHTWIN])))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (keys_data[cmdmask])
|
if (keys_data[cmdmask])
|
||||||
|
|
Loading…
Reference in New Issue