mirror of
https://github.com/glfw/glfw.git
synced 2026-11-18 04:44:54 +00:00
Added super modifier bit.
Edited during merge.
This commit is contained in:
committed by
Camilla Berglund
parent
3bcffba24a
commit
eff85f9500
@@ -213,6 +213,8 @@ static int convertKeyMods(NSUInteger flags)
|
||||
mods |= GLFW_MOD_CONTROL;
|
||||
if (flags & NSAlternateKeyMask)
|
||||
mods |= GLFW_MOD_ALT;
|
||||
if (flags & NSCommandKeyMask)
|
||||
mods |= GLFW_MOD_SUPER;
|
||||
|
||||
return mods;
|
||||
}
|
||||
|
||||
@@ -116,6 +116,8 @@ static int getKeyMods(void)
|
||||
mods |= GLFW_MOD_CONTROL;
|
||||
if (GetKeyState(VK_MENU) & (1 << 31))
|
||||
mods |= GLFW_MOD_ALT;
|
||||
if ((GetKeyState(VK_LWIN) | GetKeyState(VK_RWIN)) & (1 << 31))
|
||||
mods |= GLFW_MOD_SUPER;
|
||||
|
||||
return mods;
|
||||
}
|
||||
@@ -132,6 +134,8 @@ static int getAsyncKeyMods(void)
|
||||
mods |= GLFW_MOD_CONTROL;
|
||||
if (GetAsyncKeyState(VK_MENU) & (1 << 31))
|
||||
mods |= GLFW_MOD_ALT;
|
||||
if ((GetAsyncKeyState(VK_LWIN) | GetAsyncKeyState(VK_RWIN)) & (1 << 31))
|
||||
mods |= GLFW_MOD_SUPER;
|
||||
|
||||
return mods;
|
||||
}
|
||||
|
||||
@@ -70,6 +70,8 @@ int translateState(int state)
|
||||
mods |= GLFW_MOD_CONTROL;
|
||||
if (state & Mod1Mask)
|
||||
mods |= GLFW_MOD_ALT;
|
||||
if (state & Mod4Mask)
|
||||
mods |= GLFW_MOD_SUPER;
|
||||
|
||||
return mods;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user