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 )
{
HRESULT hr;
BYTE cKeys[256];
BYTE cKeys[256] = {0};
hr = lpDevice->didHandle->GetDeviceState( sizeof( cKeys ), (LPVOID)&cKeys );
if ( FAILED(hr) )
@ -3534,9 +3534,8 @@ DWORD ScanKeyboard( LPDEVICE lpDevice, LPDWORD lpdwCounter, LPBUTTON pButton )
}
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 ) )
{