Skip to content

Conversation

@freethinkel
Copy link
Contributor

Closes #56

@ai
Copy link
Owner

ai commented Jun 11, 2025

Can you explain a little what is the problem with digits?

What codes uses Mac?

@freethinkel
Copy link
Contributor Author

@ai
I see that my mac has a digit prefix, and I also found digit prefixes here in the w3c spec https://www.w3.org/TR/uievents-code/

image

I will also put the tests for it later

@ai
Copy link
Owner

ai commented Jun 11, 2025

Can we add the fix as separated if-block since this block is for wrong keyboard layout. Mixing two fixes in one if-block can be bad for maintaince.

@freethinkel
Copy link
Contributor Author

Okay, I will separate it, that makes sense

@freethinkel
Copy link
Contributor Author

though no, this also refers to a wrong layout, such as with alt, since on macos, as far as I can see, key changes due to holding alt(option) for a special character. Without alt(option) it's not necessary, checkHotkey detects everything correctly as it is

@freethinkel freethinkel changed the title WIP: add Digit keys handler WIP: macos Digit keys handler when alt (option) is pressed Jun 12, 2025
@freethinkel
Copy link
Contributor Author

freethinkel commented Jun 12, 2025

This is because macos changes key to special characters when alt is pressed, but for non_english layouts the code only checks for Key prefix, whereas for digits it's Digit everywhere, not just on mac

"Backquote" `~ on a US keyboard. This is the 半角/全角/漢字 (hankaku/zenkaku/kanji) key on Japanese keyboards
"Backslash" Used for both the US | (on the 101-key layout) and also for the key located between the " and Enter keys on row C of the 102-, 104- and 106-key layouts. Labelled #~ on a UK (102) keyboard.
"BracketLeft" [{ on a US keyboard.
"BracketRight" ]} on a US keyboard.
"Comma" ,< on a US keyboard.
"Digit0" 0) on a US keyboard.
"Digit1" 1! on a US keyboard.
"Digit2" 2@ on a US keyboard.
"Digit3" 3# on a US keyboard.
"Digit4" 4$ on a US keyboard.
"Digit5" 5% on a US keyboard.
"Digit6" 6^ on a US keyboard.
"Digit7" 7& on a US keyboard.
"Digit8" 8* on a US keyboard.
"Digit9" 9( on a US keyboard.
"Equal" =+ on a US keyboard.
"IntlBackslash" Located between the left Shift and Z keys. Labelled | on a UK keyboard.
"IntlRo" Located between the / and right Shift keys. Labelled \ろ (ro) on a Japanese keyboard.
"IntlYen" Located between the = and Backspace keys. Labelled ¥ (yen) on a Japanese keyboard. / on a Russian keyboard.
"KeyA" a on a US keyboard. Labelled q on an AZERTY (e.g., French) keyboard.
"KeyB" b on a US keyboard.
"KeyC" c on a US keyboard.
"KeyD" d on a US keyboard.
"KeyE" e on a US keyboard.
"KeyF" f on a US keyboard.
"KeyG" g on a US keyboard.
"KeyH" h on a US keyboard.
"KeyI" i on a US keyboard.
"KeyJ" j on a US keyboard.
"KeyK" k on a US keyboard.
"KeyL" l on a US keyboard.
"KeyM" m on a US keyboard.
"KeyN" n on a US keyboard.
"KeyO" o on a US keyboard.
"KeyP" p on a US keyboard.
"KeyQ" q on a US keyboard. Labelled a on an AZERTY (e.g., French) keyboard.
"KeyR" r on a US keyboard.
"KeyS" s on a US keyboard.
"KeyT" t on a US keyboard.
"KeyU" u on a US keyboard.
"KeyV" v on a US keyboard.
"KeyW" w on a US keyboard. Labelled z on an AZERTY (e.g., French) keyboard.
"KeyX" x on a US keyboard.
"KeyY" y on a US keyboard. Labelled z on a QWERTZ (e.g., German) keyboard.
"KeyZ" z on a US keyboard. Labelled w on an AZERTY (e.g., French) keyboard, and y on a QWERTZ (e.g., German) keyboard.
"Minus" -_ on a US keyboard.
"Period" .> on a US keyboard.
"Quote" '" on a US keyboard.
"Semicolon" ;: on a US keyboard.
"Slash" /? on a US keyboard.

It is also connected with that issue #54

@freethinkel freethinkel changed the title WIP: macos Digit keys handler when alt (option) is pressed macos Digit keys handler when alt (option) is pressed Jun 12, 2025
@freethinkel freethinkel marked this pull request as ready for review June 12, 2025 06:43
@freethinkel
Copy link
Contributor Author

@ai Hi, waiting for your review

@ai ai merged commit e4a1af1 into ai:main Jun 25, 2025
5 checks passed
@ai
Copy link
Owner

ai commented Jun 25, 2025

Thanks. Fixed in 0.11.2.

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.

Not working with digit keys on MasOS

2 participants