Move async checking for pressed keys into Host_GetKeyState()

and use wxGetKeyState on platforms other than Windows.

I am not sure if wxGetKeyState is unreliable on Windows or if
the use of GetAsyncKeyState() is simply historical, but for now
I've left the Windows call in there just in case.

This does mean that Host_GetKeyState() is currently only valid
for the small set of keycodes that overlap between wx and Win32,
one of which is VK_TAB/WXK_TAB.

Anyway, please test wxGetKeyState on Windows and remove the
ifdef if it works, so we can extend it to the remaining hotkeys.


git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6988 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Soren Jorvang
2011-01-30 16:40:38 +00:00
parent 864d24a86e
commit db1765c425
8 changed files with 26 additions and 60 deletions

View File

@ -20,6 +20,7 @@
#include "Mixer.h"
#include "AudioCommon.h"
#include "CPUDetect.h"
#include "Host.h"
#include "../../Core/Src/HW/AudioInterface.h"
@ -148,9 +149,8 @@ void CMixer::PushSamples(const short *samples, unsigned int num_samples)
if (*PowerPC::GetStatePtr() != 0)
break;
// Shortcut key for Throttle Skipping
#ifdef _WIN32
if (GetAsyncKeyState(VK_TAB)) break;;
#endif
if (Host_GetKeyState('\t'))
break;
SLEEP(1);
soundStream->Update();
}