summaryrefslogtreecommitdiffstats
path: root/src/newt
diff options
context:
space:
mode:
Diffstat (limited to 'src/newt')
-rwxr-xr-xsrc/newt/native/WindowsWindow.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/newt/native/WindowsWindow.c b/src/newt/native/WindowsWindow.c
index a4a5914bc..b86159bb1 100755
--- a/src/newt/native/WindowsWindow.c
+++ b/src/newt/native/WindowsWindow.c
@@ -461,22 +461,24 @@ static jchar* GetNullTerminatedStringChars(JNIEnv* env, jstring str)
static jint GetModifiers() {
jint modifiers = 0;
- if (HIBYTE(GetKeyState(VK_CONTROL)) != 0) {
+ // have to do &0xFF to avoid runtime assert crash caused by compiling with
+ // /RTCcsu
+ if (HIBYTE((GetKeyState(VK_CONTROL) & 0xFF)) != 0) {
modifiers |= EVENT_CTRL_MASK;
}
- if (HIBYTE(GetKeyState(VK_SHIFT)) != 0) {
+ if (HIBYTE((GetKeyState(VK_SHIFT) & 0xFF)) != 0) {
modifiers |= EVENT_SHIFT_MASK;
}
- if (HIBYTE(GetKeyState(VK_MENU)) != 0) {
+ if (HIBYTE((GetKeyState(VK_MENU) & 0xFF)) != 0) {
modifiers |= EVENT_ALT_MASK;
}
- if (HIBYTE(GetKeyState(VK_LBUTTON)) != 0) {
+ if (HIBYTE((GetKeyState(VK_LBUTTON) & 0xFF)) != 0) {
modifiers |= EVENT_BUTTON1_MASK;
}
- if (HIBYTE(GetKeyState(VK_MBUTTON)) != 0) {
+ if (HIBYTE((GetKeyState(VK_MBUTTON) & 0xFF)) != 0) {
modifiers |= EVENT_BUTTON2_MASK;
}
- if (HIBYTE(GetKeyState(VK_RBUTTON)) != 0) {
+ if (HIBYTE((GetKeyState(VK_RBUTTON) & 0xFF)) != 0) {
modifiers |= EVENT_BUTTON3_MASK;
}