mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-16 16:56:09 +03:00
only handle non-printables on press/release, and BS is 0x7F
This commit is contained in:
@ -598,10 +598,11 @@ fn keyCallback(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Handle non-printable characters
|
// Handle non-printable characters
|
||||||
|
if (action == .press or action == .repeat) {
|
||||||
const char: u8 = switch (@bitCast(u8, mods)) {
|
const char: u8 = switch (@bitCast(u8, mods)) {
|
||||||
// No modifiers pressed at all
|
// No modifiers pressed at all
|
||||||
0 => @as(u8, switch (key) {
|
0 => @as(u8, switch (key) {
|
||||||
.backspace => 0x08,
|
.backspace => 0x7F,
|
||||||
.enter => '\r',
|
.enter => '\r',
|
||||||
.tab => '\t',
|
.tab => '\t',
|
||||||
.escape => 0x1B,
|
.escape => 0x1B,
|
||||||
@ -646,6 +647,7 @@ fn keyCallback(
|
|||||||
log.err("error queueing write in keyCallback err={}", .{err});
|
log.err("error queueing write in keyCallback err={}", .{err});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fn focusCallback(window: glfw.Window, focused: bool) void {
|
fn focusCallback(window: glfw.Window, focused: bool) void {
|
||||||
const tracy = trace(@src());
|
const tracy = trace(@src());
|
||||||
|
Reference in New Issue
Block a user