Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Clark Lin
hw3d
Commits
7e429cd5
Commit
7e429cd5
authored
Dec 11, 2018
by
chili
Browse files
configurable autorepeat filter
parent
1466aa84
Changes
2
Hide whitespace changes
Inline
Side-by-side
hw3d/WinMain.cpp
View file @
7e429cd5
...
@@ -37,10 +37,6 @@ int CALLBACK WinMain(
...
@@ -37,10 +37,6 @@ int CALLBACK WinMain(
// TranslateMessage will post auxilliary WM_CHAR messages from key msgs
// TranslateMessage will post auxilliary WM_CHAR messages from key msgs
TranslateMessage
(
&
msg
);
TranslateMessage
(
&
msg
);
DispatchMessage
(
&
msg
);
DispatchMessage
(
&
msg
);
if
(
wnd
.
kbd
.
KeyIsPressed
(
VK_SPACE
)
)
{
MessageBox
(
nullptr
,
"Something Happon!"
,
"Space Key Was Pressed"
,
MB_OK
|
MB_ICONEXCLAMATION
);
}
}
}
// check if GetMessage call itself borked
// check if GetMessage call itself borked
...
...
hw3d/Window.cpp
View file @
7e429cd5
...
@@ -144,7 +144,10 @@ LRESULT Window::HandleMsg( HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam ) noex
...
@@ -144,7 +144,10 @@ LRESULT Window::HandleMsg( HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam ) noex
/*********** KEYBOARD MESSAGES ***********/
/*********** KEYBOARD MESSAGES ***********/
case
WM_KEYDOWN
:
case
WM_KEYDOWN
:
kbd
.
OnKeyPressed
(
static_cast
<
unsigned
char
>
(
wParam
)
);
if
(
!
(
lParam
&
0x40000000
)
||
kbd
.
AutorepeatIsEnabled
()
)
// filter autorepeat
{
kbd
.
OnKeyPressed
(
static_cast
<
unsigned
char
>
(
wParam
)
);
}
break
;
break
;
case
WM_KEYUP
:
case
WM_KEYUP
:
kbd
.
OnKeyReleased
(
static_cast
<
unsigned
char
>
(
wParam
)
);
kbd
.
OnKeyReleased
(
static_cast
<
unsigned
char
>
(
wParam
)
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment