J :
* Add support for the input buffer
This commit is contained in:
+24
-1
@@ -491,6 +491,27 @@ actualHeight = height;
|
|||||||
return TRUE; // Success
|
return TRUE; // Success
|
||||||
}
|
}
|
||||||
|
|
||||||
|
u32 JGEReadKey()
|
||||||
|
{
|
||||||
|
if (gKeyBuffer.empty()) return 0;
|
||||||
|
u32 val = gKeyBuffer.front().first;
|
||||||
|
gKeyBuffer.pop();
|
||||||
|
return val;
|
||||||
|
}
|
||||||
|
|
||||||
|
u32 JGEReadLocalKey()
|
||||||
|
{
|
||||||
|
if (gKeyBuffer.empty()) return 0;
|
||||||
|
u32 val = gKeyBuffer.front().second;
|
||||||
|
gKeyBuffer.pop();
|
||||||
|
return val;
|
||||||
|
}
|
||||||
|
|
||||||
|
void JGEResetInput()
|
||||||
|
{
|
||||||
|
while (!gKeyBuffer.empty()) gKeyBuffer.pop();
|
||||||
|
}
|
||||||
|
|
||||||
LRESULT CALLBACK WndProc( HWND hWnd, // Handle For This Window
|
LRESULT CALLBACK WndProc( HWND hWnd, // Handle For This Window
|
||||||
UINT uMsg, // Message For This Window
|
UINT uMsg, // Message For This Window
|
||||||
WPARAM wParam, // Additional Message Information
|
WPARAM wParam, // Additional Message Information
|
||||||
@@ -537,7 +558,9 @@ LRESULT CALLBACK WndProc( HWND hWnd, // Handle For This Window
|
|||||||
if ((wParam >= 0) && (wParam <= 255)) // Is Key (wParam) In A Valid Range?
|
if ((wParam >= 0) && (wParam <= 255)) // Is Key (wParam) In A Valid Range?
|
||||||
{
|
{
|
||||||
g_keys[wParam] = TRUE; // Set The Selected Key (wParam) To True
|
g_keys[wParam] = TRUE; // Set The Selected Key (wParam) To True
|
||||||
return 0; // Return
|
for (signed int i = sizeof(gWinKeyCodes)/sizeof(gWinKeyCodes[0]); i > 0; --i)
|
||||||
|
if (gWinKeyCodes[i] == wParam) { gKeyBuffer.push(make_pair(gPSPKeyMasks[i],0x8000+key)); return 0; }
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
break; // Break
|
break; // Break
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user