Skip to content

Commit

Permalink
[SP] Add numpad 0-9 conversion to 0-9 with numlock on from MP engine.
Browse files Browse the repository at this point in the history
This will mean the numbered numpad keys can only be bound to separate binds from numbers when numlock is off which is same as MP now.
But you will be able to use the numpad numbers in console/textboxes now.
  • Loading branch information
ensiform committed Nov 9, 2014
1 parent 5af7097 commit e04792c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions code/win32/win_wndproc.cpp
Expand Up @@ -249,6 +249,16 @@ static int MapKey (ulong key, word wParam)
extended = (key >> 24) & 1;
if(wParam > 0 && wParam <= VK_SCROLL)
{
// yeuch, but oh well...
//
if ( wParam >= VK_NUMPAD0 && wParam <= VK_NUMPAD9 )
{
bool bNumlockOn = !!(GetKeyState( VK_NUMLOCK ) & 1);
if ( bNumlockOn )
{
wParam = 0x30 + (wParam - VK_NUMPAD0); // convert to standard 0..9
}
}
result = virtualKeyConvert[wParam][extended];
}
// Get the unshifted ascii code (if any)
Expand Down

0 comments on commit e04792c

Please sign in to comment.