mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-21 03:06:15 +03:00

Fixes #1014 There were a couple overlapping issues here: 1. To determine the "unshifted" key, we were using `keyval_to_lower`. This only works if the key is uppercase and not all layouts are uppercase for the unshifted value. 2. If we couldn't case the unicode value of a key or unshifted key to ASCII, we'd say the key was the same as the physical key. This is incorrect because the physical key is always the layout of the physical keyboard so for example with the Turkish layout on a US keyboard, you'd get US letters when a key may only correspond to non-US letters. To fix the first issue, we are using map_keycode to map the hardware keycode to all possible keyvals from it. We then use the currently active layout to find the unshifted value. To fix the scond issue, we no longer fallback to the physical key if there was IM text or non-ASCII unicode values for the key. I tested Turkish with #1014 and I tested Dvorak to make sure those basics still work.