Skip to content

Commit caca046

Browse files
PCManPCMan
authored andcommitted
Fix bug in key state detection and fix bugs in Capslock and Shift key handling.
1 parent 023ef9d commit caca046

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

KeyEvent.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ class KeyEvent {
6666
}
6767

6868
bool isKeyDown(UINT code) const {
69-
return (keyStates_[code] & (1 << 8)) != 0;
69+
return (keyStates_[code] & (1 << 7)) != 0;
7070
}
7171

7272
bool isKeyToggled(UINT code) const {
@@ -98,7 +98,7 @@ class KeyState {
9898
}
9999

100100
bool isDown() {
101-
return ((state_ & (1 << 16)) != 0);
101+
return ((state_ & (1 << 15)) != 0);
102102
}
103103

104104
bool isToggled() {

0 commit comments

Comments
 (0)