switched uint8_t -> bool in input, no pressure sense

This commit is contained in:
Hay1tsme
2022-01-09 12:30:31 -05:00
parent 315a272a03
commit d633cb9838
3 changed files with 11 additions and 11 deletions

View File

@ -89,21 +89,21 @@ void mercury_io_touch_start(mercury_io_touch_callback_t callback)
static unsigned int __stdcall mercury_io_touch_thread_proc(void *ctx)
{
mercury_io_touch_callback_t callback;
uint8_t pressure[240];
bool cellPressed[240];
size_t i;
callback = ctx;
while (!mercury_io_touch_stop_flag) {
for (i = 0 ; i < _countof(pressure) ; i++) {
if (GetAsyncKeyState(mercury_io_cfg.vk_cell[i]) & 0x8000) {
pressure[i] = 128;
for (i = 0 ; i < _countof(cellPressed) ; i++) {
if (GetAsyncKeyState(mercury_io_cfg.vk_cell[i])) {
cellPressed[i] = true;
} else {
pressure[i] = 0;
cellPressed[i] = false;
}
}
callback(pressure);
callback(cellPressed);
Sleep(1);
}

View File

@ -14,7 +14,7 @@ enum {
MERCURY_IO_GAMEBTN_VOL_DOWN = 0x02,
};
typedef void (*mercury_io_touch_callback_t)(const uint8_t *state);
typedef void (*mercury_io_touch_callback_t)(const bool *state);
/* Get the version of the Wacca IO API that this DLL supports. This
function should return a positive 16-bit integer, where the high byte is
the major version and the low byte is the minor version (as defined by the