Skip to content

BadUSB: Fix key combos main keys being case sensitive #4216

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

WillyJL
Copy link
Contributor

@WillyJL WillyJL commented May 8, 2025

What's new

  • [FL-3962] BadUSB arbitrary key combinations #4156 added arbitrary key combinations but changed the parsing of the main key of the key combo from ducky_get_keycode() to ducky_get_keycode_by_name() + BADUSB_ASCII_TO_KEY()
  • this works fine, but has the side effect of changing behavior slightly: BADUSB_ASCII_TO_KEY() will return a keycode with modifier included, such as BADUSB_ASCII_TO_KEY(bad_usb, 'Z') will return the equivalent of SHIFT z not just z
  • this was noticed by a user, where CTRL-ALT Z was no longer pressing ctrl+alt+z, but instead ctrl+shift+alt+z
  • on one hand, it is simple enough to change to CTRL-ALT z, but on the other it seems more appropriate to consider keycodes without modifiers while processing a key combination, as the user is expected to specify it with CTRL-SHIFT-ALT Z for example, so this PR changes to the latter behavior, as it is also how key combinations worked previously; automatically adding modifiers such as SHIFT z with BADUSB_ASCII_TO_KEY() is used in the STRING and related commands, where it is more appropriate

Verification

Checklist (For Reviewer)

  • PR has description of feature/bug or link to Confluence/Jira task
  • Description contains actions to verify feature/bugfix
  • I've built this code, uploaded it to the device and verified feature/bugfix

@hedger hedger added USB BadUSB + physical USB interface Bug labels May 12, 2025
@hedger hedger self-assigned this May 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug USB BadUSB + physical USB interface
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants