summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/corelib/kernel/qcoreapplication_win.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/corelib/kernel/qcoreapplication_win.cpp b/src/corelib/kernel/qcoreapplication_win.cpp
index cb6d39a481..1b51e6f568 100644
--- a/src/corelib/kernel/qcoreapplication_win.cpp
+++ b/src/corelib/kernel/qcoreapplication_win.cpp
@@ -867,9 +867,9 @@ QString decodeMSG(const MSG& msg)
long lKeyData = (long)lParam;
int repCount = (lKeyData & 0xffff); // Bit 0-15
int scanCode = (lKeyData & 0xf0000) >> 16; // Bit 16-23
- bool contextCode = (lKeyData && 0x20000000); // Bit 29
- bool prevState = (lKeyData && 0x40000000); // Bit 30
- bool transState = (lKeyData && 0x80000000); // Bit 31
+ bool contextCode = !!(lKeyData & 0x20000000); // Bit 29
+ bool prevState = !!(lKeyData & 0x40000000); // Bit 30
+ bool transState = !!(lKeyData & 0x80000000); // Bit 31
parameters.sprintf("Virual-key(0x%x) Scancode(%d) Rep(%d) Contextcode(%d), Prev state(%d), Trans state(%d)",
nVirtKey, scanCode, repCount, contextCode, prevState, transState);
}