Update Interface.cpp (#2367)

This commit is contained in:
Nayla 2023-06-02 17:41:57 -04:00 committed by GitHub
parent f4459fe143
commit 18a712ce6a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 3 deletions

View File

@ -3524,7 +3524,7 @@ bool GetButtonText( const BUTTON& btnButton, LPTSTR Buffer )
DWORD ScanKeyboard( LPDEVICE lpDevice, LPDWORD lpdwCounter, LPBUTTON pButton ) DWORD ScanKeyboard( LPDEVICE lpDevice, LPDWORD lpdwCounter, LPBUTTON pButton )
{ {
HRESULT hr; HRESULT hr;
BYTE cKeys[256]; BYTE cKeys[256] = {0};
hr = lpDevice->didHandle->GetDeviceState( sizeof( cKeys ), (LPVOID)&cKeys ); hr = lpDevice->didHandle->GetDeviceState( sizeof( cKeys ), (LPVOID)&cKeys );
if ( FAILED(hr) ) if ( FAILED(hr) )
@ -3534,9 +3534,8 @@ DWORD ScanKeyboard( LPDEVICE lpDevice, LPDWORD lpdwCounter, LPBUTTON pButton )
} }
int iGotKey = FALSE; int iGotKey = FALSE;
int i = 0;
for( i = 0; i < ARRAYSIZE( cKeys ); ++i ) for( int i = 1; i < ARRAYSIZE( cKeys ); ++i )
{ {
if (( cKeys[i] & 0x80 ) ) if (( cKeys[i] & 0x80 ) )
{ {