BadKB fix using only modifier keys by themselves

This commit is contained in:
Willy-JL
2023-07-10 22:11:25 +02:00
parent 4a50466f8c
commit 24bf657bba

View File

@@ -294,8 +294,12 @@ static int32_t ducky_parse_line(BadKbScript* bad_kb, FuriString* line) {
}
if((key & 0xFF00) != 0) {
// It's a modifier key
line_tmp = &line_tmp[ducky_get_command_len(line_tmp) + 1];
key |= ducky_get_keycode(bad_kb, line_tmp, true);
uint32_t offset = ducky_get_command_len(line_tmp) + 1;
// ducky_get_command_len() returns 0 without space, so check for != 1
if(offset != 1 && line_len > offset) {
// It's also a key combination
key |= ducky_get_keycode(bad_kb, line_tmp + offset, true);
}
}
if(bad_kb->bt) {
furi_hal_bt_hid_kb_press(key);