tony / oxwm

Fixed intcast issue by adding upper_letters and digits []u8s and map a to z kysms to said []u8s Browse files
tonybanters committed 2026-02-08 parent 1b7f7f2 commit 5b0eb5f16a5763350e683b88901c64b3057bc53f
Showing 1 changed file with 6 additions and 3 deletions. UnifiedSplit
+6 −3 src/overlay.zig
@@ -311,6 +311,9 @@ pub const Keybind_Overlay = struct {
311 } 311 }
312 312
313 fn keysym_to_name(keysym: u64) []const u8 { 313 fn keysym_to_name(keysym: u64) []const u8 {
314 + const upper_letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
315 + const digits = "0123456789";
316 +
314 return switch (keysym) { 317 return switch (keysym) {
315 0xff0d => "Return", 318 0xff0d => "Return",
316 0x0020 => "Space", 319 0x0020 => "Space",
@@ -336,9 +339,9 @@ pub const Keybind_Overlay = struct {
336 0x002c => ",", 339 0x002c => ",",
337 0x002e => ".", 340 0x002e => ".",
338 0x002f => "/", 341 0x002f => "/",
339 - 'a'...'z' => |c| &[_]u8{@intCast(c - 32)}, 342 + 'a'...'z' => |c| upper_letters[c - 'a' ..][0..1],
340 - 'A'...'Z' => |c| &[_]u8{@intCast(c)}, 343 + 'A'...'Z' => |c| upper_letters[c - 'A' ..][0..1],
341 - '0'...'9' => |c| &[_]u8{@intCast(c)}, 344 + '0'...'9' => |c| digits[c - '0' ..][0..1],
342 else => "?", 345 else => "?",
343 }; 346 };
344 } 347 }