gtk(input): fix value used for lowercase lower_unicode

When converting keyval to the unshifted version, gdk_keyval_to_lower
returns a keyval type, not a unicode value. Convert this to unicode
before assigning to keyval_unicode_unshifted.

This fixes a bug where the incorrect keycode is sent in alternate
layouts with kitty keyboard on linux.
This commit is contained in:
Tim Culverhouse
2023-09-28 10:12:43 -05:00
parent 3ef67fe025
commit 4f2d67d8f3

View File

@ -757,8 +757,8 @@ fn keyEvent(
// Norwegian, and French layouts and thats what we have real users for
// right now.
const lower = c.gdk_keyval_to_lower(keyval);
if (std.math.cast(u21, lower)) |val| break :unshifted val;
break :unshifted 0;
const lower_unicode = c.gdk_keyval_to_unicode(lower);
break :unshifted std.math.cast(u21, lower_unicode) orelse 0;
};
// We always reset our committed text when ending a keypress so that