Fiter test
This commit is contained in:
parent
f27a452d0d
commit
39eda1e38b
3 changed files with 36 additions and 8 deletions
27
input_dev.c
27
input_dev.c
|
|
@ -37,6 +37,33 @@ int input_filter_asus_kb(struct input_event* events, size_t* size, uint32_t* cou
|
|||
return INPUT_FILTER_RESULT_DO_NOT_EMIT;
|
||||
} else if ((*count >= 2) && (events[0].type == EV_MSC) && (events[0].code == MSC_SCAN) && (events[0].value == -13565784)) {
|
||||
return INPUT_FILTER_RESULT_DO_NOT_EMIT;
|
||||
} else if ((*count == 2) && (events[0].type == EV_MSC) && (events[0].code == MSC_SCAN) && (events[0].value == 458860)) {
|
||||
if ((events[1].type == EV_KEY) && (events[1].code == KEY_F17)) {
|
||||
if (events[1].value < 2) {
|
||||
*count = 1;
|
||||
events[0].type = EV_KEY;
|
||||
events[0].code = BTN_GEAR_DOWN;
|
||||
events[0].value = events[1].value;
|
||||
}
|
||||
}
|
||||
} else if ((*count == 2) && (events[0].type == EV_MSC) && (events[0].code == MSC_SCAN) && (events[0].value == 458861)) {
|
||||
if ((events[1].type == EV_KEY) && (events[1].code == KEY_F18)) {
|
||||
if (events[1].value < 2) {
|
||||
*count = 1;
|
||||
events[0].type = EV_KEY;
|
||||
events[0].code = BTN_GEAR_UP;
|
||||
events[0].value = events[1].value;
|
||||
}
|
||||
}
|
||||
} else if ((*count == 2) && (events[0].type == EV_MSC) && (events[0].code == MSC_SCAN) && (events[0].value == -13565786)) {
|
||||
if ((events[1].type == EV_KEY) && (events[1].code == KEY_F16)) {
|
||||
if (events[1].value < 2) {
|
||||
*count = 1;
|
||||
events[0].type = EV_KEY;
|
||||
events[0].code = BTN_MODE;
|
||||
events[0].value = events[1].value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return INPUT_FILTER_RESULT_OK;
|
||||
|
|
|
|||
10
output_dev.c
10
output_dev.c
|
|
@ -410,15 +410,11 @@ void *output_dev_thread_func(void *ptr) {
|
|||
.time = now,
|
||||
};
|
||||
|
||||
if ((ev.type == EV_KEY) && (ev.code == KEY_F16)) {
|
||||
ev.code = BTN_MODE;
|
||||
} else if ((ev.type == EV_KEY) && (ev.code == KEY_PROG1)) { // To be wired to F16
|
||||
/*
|
||||
if ((ev.type == EV_KEY) && (ev.code == KEY_PROG1)) { // To be wired to F16
|
||||
ev.code = KEY_F12;
|
||||
} else if ((ev.type == EV_KEY) && (ev.code == KEY_F18)) { // To be wired to F16
|
||||
ev.code = BTN_GEAR_UP;
|
||||
} else if ((ev.type == EV_KEY) && (ev.code == KEY_F17)) { // To be wired to F16
|
||||
ev.code = BTN_GEAR_DOWN;
|
||||
}
|
||||
*/
|
||||
|
||||
#if defined(INCLUDE_OUTPUT_DEBUG)
|
||||
printf(
|
||||
|
|
|
|||
|
|
@ -41,7 +41,12 @@ int cycle_mode() {
|
|||
fprintf(stderr, "Asus MCU not registered: aborting.\n");
|
||||
}
|
||||
|
||||
char new_mode_str[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
|
||||
char new_mode_str[] = {
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00
|
||||
};
|
||||
|
||||
unsigned long new_mode = (global_platform->mode + 1) % global_platform->modes_count;
|
||||
sprintf(new_mode_str, "%lu\n", new_mode);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue