Skip to content

Fix valid checking for keycodes#337

Open
AkariiinMKII wants to merge 2 commits intothe-via:mainfrom
AkariiinMKII:fix-valid-check
Open

Fix valid checking for keycodes#337
AkariiinMKII wants to merge 2 commits intothe-via:mainfrom
AkariiinMKII:fix-valid-check

Conversation

@AkariiinMKII
Copy link
Copy Markdown

@AkariiinMKII AkariiinMKII commented Jul 10, 2025

This PR fixed valid checking for keycodes in some situations

  1. When using a hex value in custom key any, only accept hex formed string in range of 0x0000 and 0xffff, including leading zero value and non leading zero value

    • Before changes
      28426ca97f222a3781dc1f2cf1da4fbf4c2844a920d0a5d862c6719610d8ef6ff2e759262b92872b9a1b0498303cd37d
    • After changes
      imageimageimageimage
  2. Dim the unsupported keys in select area and block click actions, it is a previously built function and disabled due to the bug
    image

  3. When selecting an unsupported keycode (if possible), block the applying action.
    Before the changes, it will apply with keycode 0 (aka. KC_NO)

  4. When applying a saved layout which includes unsupported keycodes, replace them with KC_NO, port error message to console and list them on web page
    image
    image
    There is no message output before changes.

  5. Fix keycode checking for mod combo keys in Any

    if (bytes.find((e) => e === null)) {

    The find method returns null for invalid keycodes and if (null) equals to if (false) in this case

    • Before changes
    image
    • After changes
    image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant