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,19 +102,31 @@ void chuni_io_jvs_poll(uint8_t *opbtn, uint8_t *beams)
*opbtn |= CHUNI_IO_OPBTN_SERVICE; /* Service */
}
if (GetAsyncKeyState(chuni_io_cfg.vk_ir_emu)) {
if (chuni_io_hand_pos < 6) {
chuni_io_hand_pos++;
if (chuni_io_cfg.vk_ir_emu) {
// Use emulated AIR
if (GetAsyncKeyState(chuni_io_cfg.vk_ir_emu)) {
if (chuni_io_hand_pos < 6) {
chuni_io_hand_pos++;
}
} else {
if (chuni_io_hand_pos > 0) {
chuni_io_hand_pos--;
}
}
for (i = 0 ; i < 6 ; i++) {
if (chuni_io_hand_pos > i) {
*beams |= (1 << i);
}
}
} else {
if (chuni_io_hand_pos > 0) {
chuni_io_hand_pos--;
}
}
for (i = 0 ; i < 6 ; i++) {
if (chuni_io_hand_pos > i) {
*beams |= (1 << i);
// 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);
}
}
}

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',
],
)