From 18a712ce6a7e0d34d4e5d168bdb4ee65328b691b Mon Sep 17 00:00:00 2001 From: Nayla Date: Fri, 2 Jun 2023 17:41:57 -0400 Subject: [PATCH] Update Interface.cpp (#2367) --- Source/nragev20/Interface.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Source/nragev20/Interface.cpp b/Source/nragev20/Interface.cpp index a29a3407b..82b2175bf 100644 --- a/Source/nragev20/Interface.cpp +++ b/Source/nragev20/Interface.cpp @@ -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 ) ) {