Commit 7e429cd5 authored by chili's avatar chili
Browse files

configurable autorepeat filter

parent 1466aa84
...@@ -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
......
...@@ -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) );
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment