Add very simple rapid fire for Windows keyboard.

Mostly to speed up debugging.
This commit is contained in:
Unknown W. Brackets 2013-02-10 22:56:54 -08:00
parent b33c94ab93
commit e8e9f7f9d8
2 changed files with 6 additions and 1 deletions

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]);

View File

@ -773,6 +773,7 @@ namespace MainWindow
"Analog Down\tK",
"Analog Left\tJ",
"Analog Right\tL",
"Rapid Fire\tShift",
};
// Message handler for about box.
LRESULT CALLBACK Controls(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)