parent
ed1194cd75
commit
c4f1c78fcf
|
|
@ -1066,6 +1066,16 @@ extension Ghostty {
|
|||
|
||||
equivalent = "\r"
|
||||
|
||||
case "/":
|
||||
// Treat C-/ as C-_. We do this because C-/ makes macOS make a beep
|
||||
// sound and we don't like the beep sound.
|
||||
if (!event.modifierFlags.contains(.control) ||
|
||||
!event.modifierFlags.isDisjoint(with: [.shift, .command, .option])) {
|
||||
return false
|
||||
}
|
||||
|
||||
equivalent = "_"
|
||||
|
||||
default:
|
||||
// It looks like some part of AppKit sometimes generates synthetic NSEvents
|
||||
// with a zero timestamp. We never process these at this point. Concretely,
|
||||
|
|
|
|||
|
|
@ -149,9 +149,6 @@ pub const Mods = packed struct(Mods.Backing) {
|
|||
pub fn translation(self: Mods, option_as_alt: config.OptionAsAlt) Mods {
|
||||
var result = self;
|
||||
|
||||
// Control is never used for translation.
|
||||
result.ctrl = false;
|
||||
|
||||
// macos-option-as-alt for darwin
|
||||
if (comptime builtin.target.os.tag.isDarwin()) alt: {
|
||||
// Alt has to be set only on the correct side
|
||||
|
|
@ -187,14 +184,6 @@ pub const Mods = packed struct(Mods.Backing) {
|
|||
);
|
||||
}
|
||||
|
||||
test "translation removes control" {
|
||||
const testing = std.testing;
|
||||
|
||||
const mods: Mods = .{ .ctrl = true };
|
||||
const result = mods.translation(.true);
|
||||
try testing.expectEqual(Mods{}, result);
|
||||
}
|
||||
|
||||
test "translation macos-option-as-alt" {
|
||||
if (comptime !builtin.target.os.tag.isDarwin()) return error.SkipZigTest;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue