|
From: thricenightly (<del...@gm...> - 2017-06-18 12:21:34
|
I'm trying to work out why this program won't show all 5 keys being pressed simultaneously:
[code]#include <stdio.h>
#include <input.h>
#include <arch/zx.h>
int main()
{
zx_cls(PAPER_WHITE);
while( 1 ) {
printf("\x16\x01\x01");
printf("Scancode is 0x%04X\n", in_key_pressed( IN_KEY_SCANCODE_q ));
printf("Scancode is 0x%04X\n", in_key_pressed( IN_KEY_SCANCODE_a ));
printf("Scancode is 0x%04X\n", in_key_pressed( IN_KEY_SCANCODE_o ));
printf("Scancode is 0x%04X\n", in_key_pressed( IN_KEY_SCANCODE_p ));
printf("Scancode is 0x%04X\n\n", in_key_pressed( IN_KEY_SCANCODE_SPACE ));
}
}[/code]
I think it's the nature of the keyboard matrix as described here:
http://www.worldofspectrum.org/faq/reference/48kreference.htm
but I can't quite get my head around what's happening. Can someone explain?
|