From b799f9f4465193f3665d2ea9ffef59b757bae48b Mon Sep 17 00:00:00 2001 From: Tau Date: Sun, 17 Nov 2019 13:16:50 -0500 Subject: [PATCH] Simplify configurable GetAsyncKeyState Setting the VK code to zero effectively disables these anyway. --- amex/gpio.c | 4 ++-- idzio/dllmain.c | 6 ++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/amex/gpio.c b/amex/gpio.c index ffd1fc0..4e18630 100644 --- a/amex/gpio.c +++ b/amex/gpio.c @@ -196,11 +196,11 @@ static HRESULT gpio_ioctl_get_psw(struct irp *irp) /* Bit 0 == SW1 == Alt. Test */ /* Bit 1 == SW2 == Alt. Service */ - if (gpio_config.vk_sw1 && (GetAsyncKeyState(gpio_config.vk_sw1) & 0x8000)) { + if (GetAsyncKeyState(gpio_config.vk_sw1) & 0x8000) { result |= 1 << 0; } - if (gpio_config.vk_sw2 && (GetAsyncKeyState(gpio_config.vk_sw2) & 0x8000)) { + if (GetAsyncKeyState(gpio_config.vk_sw2) & 0x8000) { result |= 1 << 1; } diff --git a/idzio/dllmain.c b/idzio/dllmain.c index 8ebea53..5edf67c 100644 --- a/idzio/dllmain.c +++ b/idzio/dllmain.c @@ -50,13 +50,11 @@ void idz_io_jvs_read_buttons(uint8_t *opbtn_out, uint8_t *gamebtn_out) opbtn = 0; - if ( idz_io_cfg.vk_test && - (GetAsyncKeyState(idz_io_cfg.vk_test) & 0x8000)) { + if (GetAsyncKeyState(idz_io_cfg.vk_test) & 0x8000) { opbtn |= IDZ_IO_OPBTN_TEST; } - if ( idz_io_cfg.vk_service && - (GetAsyncKeyState(idz_io_cfg.vk_service) & 0x8000)) { + if (GetAsyncKeyState(idz_io_cfg.vk_service) & 0x8000) { opbtn |= IDZ_IO_OPBTN_SERVICE; }