1
mirror of https://github.com/DarkFlippers/unleashed-firmware.git synced 2025-12-12 04:34:43 +04:00

upd nfc maker / badusb fixes

by @Willy-JL
This commit is contained in:
MX
2023-07-11 13:40:46 +03:00
parent 9d98724dcb
commit bc0722fe25
3 changed files with 209 additions and 181 deletions

View File

@@ -198,8 +198,12 @@ static int32_t ducky_parse_line(BadUsbScript* bad_usb, 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_usb, 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_usb, line_tmp + offset, true);
}
}
furi_hal_hid_kb_press(key);
furi_hal_hid_kb_release(key);