Add very simple rapid fire for Windows keyboard.

Mostly to speed up debugging.
This commit is contained in:
Unknown W. Brackets committed 2013-02-11 01:27:06 -08:00
1 parent b33c94ab93
commit e8e9f7f9d8
2 files changed
+6 -1

No files matched your search

+5 -1
View File
@@ -26,8 +26,12 @@ static const unsigned short analog_ctrl_map[] = {
};
int KeyboardDevice::UpdateState() {
bool alternate = GetAsyncKeyState(VK_SHIFT) != 0;
static u32 alternator = 0;
bool doAlternate = alternate && (alternator++ % 10) < 5;
for (int i = 0; i < sizeof(key_ctrl_map)/sizeof(key_ctrl_map[0]); i += 2) {
if (!GetAsyncKeyState(key_ctrl_map[i]))
if (!GetAsyncKeyState(key_ctrl_map[i]) || doAlternate)
__CtrlButtonUp(key_ctrl_map[i+1]);
else {
__CtrlButtonDown(key_ctrl_map[i+1]);