Add individual air keyboard buttons

This commit is contained in:
Dniel97 2024-10-04 16:01:56 +02:00
parent f4fda04f6b
commit 7f4b231c97
Signed by: Dniel97
GPG Key ID: 6180B3C768FB2E08
6 changed files with 51 additions and 11 deletions

View File

@ -0,0 +1,14 @@
shared_library(
'aime_brokenithm',
name_prefix : '',
vs_module_defs : 'aimeio.def',
include_directories : inc,
implicit_include_directories : false,
link_with : [
aimeio_lib,
],
sources : [
'aimeio.c',
],
)

View File

@ -102,6 +102,8 @@ void chuni_io_jvs_poll(uint8_t *opbtn, uint8_t *beams)
*opbtn |= CHUNI_IO_OPBTN_SERVICE; /* Service */ *opbtn |= CHUNI_IO_OPBTN_SERVICE; /* Service */
} }
if (chuni_io_cfg.vk_ir_emu) {
// Use emulated AIR
if (GetAsyncKeyState(chuni_io_cfg.vk_ir_emu)) { if (GetAsyncKeyState(chuni_io_cfg.vk_ir_emu)) {
if (chuni_io_hand_pos < 6) { if (chuni_io_hand_pos < 6) {
chuni_io_hand_pos++; chuni_io_hand_pos++;
@ -117,6 +119,16 @@ void chuni_io_jvs_poll(uint8_t *opbtn, uint8_t *beams)
*beams |= (1 << i); *beams |= (1 << i);
} }
} }
} else {
// Use actual AIR
for (i = 0; i < 6; i++) {
if(GetAsyncKeyState(chuni_io_cfg.vk_ir[i]) & 0x8000) {
*beams |= (1 << i);
} else {
*beams &= ~(1 << i);
}
}
}
// IR format is beams[5:0] = {b5,b6,b3,b4,b1,b2}; // IR format is beams[5:0] = {b5,b6,b3,b4,b1,b2};
for (i = 0 ; i < 3 ; i++) { for (i = 0 ; i < 3 ; i++) {

View File

@ -0,0 +1,14 @@
shared_library(
'brokenithm',
name_prefix : '',
vs_module_defs : 'chuniio.def',
include_directories : inc,
implicit_include_directories : false,
link_with : [
chuniio_lib,
],
sources : [
'chuniio.c',
],
)