mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-20 18:56:08 +03:00
apprt/embedded: ctrl-only should use binding-mods only
This allows it to ignore control side differences.
This commit is contained in:
@ -780,7 +780,7 @@ pub const Surface = struct {
|
|||||||
// we just avoid this by never allowing AppKit to translate
|
// we just avoid this by never allowing AppKit to translate
|
||||||
// ctrl+<char> and instead do it ourselves.
|
// ctrl+<char> and instead do it ourselves.
|
||||||
const ctrl_only = comptime (input.Mods{ .ctrl = true }).int();
|
const ctrl_only = comptime (input.Mods{ .ctrl = true }).int();
|
||||||
break :event_text if (mods.int() == ctrl_only) null else event.text;
|
break :event_text if (mods.binding().int() == ctrl_only) null else event.text;
|
||||||
};
|
};
|
||||||
|
|
||||||
// Translate our key using the keymap for our localized keyboard layout.
|
// Translate our key using the keymap for our localized keyboard layout.
|
||||||
|
@ -1895,6 +1895,11 @@ test "ctrlseq: normal ctrl c" {
|
|||||||
try testing.expectEqual(@as(u8, 0x03), seq.?);
|
try testing.expectEqual(@as(u8, 0x03), seq.?);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
test "ctrlseq: normal ctrl c, right control" {
|
||||||
|
const seq = ctrlSeq("c", .{ .ctrl = true, .sides = .{ .ctrl = .right } });
|
||||||
|
try testing.expectEqual(@as(u8, 0x03), seq.?);
|
||||||
|
}
|
||||||
|
|
||||||
test "ctrlseq: alt should be allowed" {
|
test "ctrlseq: alt should be allowed" {
|
||||||
const seq = ctrlSeq("c", .{ .alt = true, .ctrl = true });
|
const seq = ctrlSeq("c", .{ .alt = true, .ctrl = true });
|
||||||
try testing.expectEqual(@as(u8, 0x03), seq.?);
|
try testing.expectEqual(@as(u8, 0x03), seq.?);
|
||||||
|
Reference in New Issue
Block a user