mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-08-02 14:57:31 +03:00
Make undo, cut, copy, paste keys mappable
This commit is contained in:
@ -252,6 +252,10 @@ typedef enum {
|
|||||||
GHOSTTY_KEY_BACKSPACE,
|
GHOSTTY_KEY_BACKSPACE,
|
||||||
GHOSTTY_KEY_PRINT_SCREEN,
|
GHOSTTY_KEY_PRINT_SCREEN,
|
||||||
GHOSTTY_KEY_PAUSE,
|
GHOSTTY_KEY_PAUSE,
|
||||||
|
GHOSTTY_KEY_UNDO,
|
||||||
|
GHOSTTY_KEY_CUT,
|
||||||
|
GHOSTTY_KEY_COPY,
|
||||||
|
GHOSTTY_KEY_PASTE,
|
||||||
|
|
||||||
// function keys
|
// function keys
|
||||||
GHOSTTY_KEY_F1,
|
GHOSTTY_KEY_F1,
|
||||||
|
@ -1125,6 +1125,16 @@ pub fn default(alloc_gpa: Allocator) Allocator.Error!Config {
|
|||||||
.{ .paste_from_clipboard = {} },
|
.{ .paste_from_clipboard = {} },
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
try result.keybind.set.put(
|
||||||
|
alloc,
|
||||||
|
.{ .key = .copy },
|
||||||
|
.{ .copy_to_clipboard = {} },
|
||||||
|
);
|
||||||
|
try result.keybind.set.put(
|
||||||
|
alloc,
|
||||||
|
.{ .key = .paste },
|
||||||
|
.{ .paste_from_clipboard = {} },
|
||||||
|
);
|
||||||
|
|
||||||
// Fonts
|
// Fonts
|
||||||
try result.keybind.set.put(
|
try result.keybind.set.put(
|
||||||
|
@ -307,6 +307,10 @@ pub const Key = enum(c_int) {
|
|||||||
backspace,
|
backspace,
|
||||||
print_screen,
|
print_screen,
|
||||||
pause,
|
pause,
|
||||||
|
undo,
|
||||||
|
cut,
|
||||||
|
copy,
|
||||||
|
paste,
|
||||||
|
|
||||||
// function keys
|
// function keys
|
||||||
f1,
|
f1,
|
||||||
@ -616,6 +620,10 @@ pub const Key = enum(c_int) {
|
|||||||
|
|
||||||
// These keys aren't represented in cimgui
|
// These keys aren't represented in cimgui
|
||||||
.plus,
|
.plus,
|
||||||
|
.undo,
|
||||||
|
.cut,
|
||||||
|
.copy,
|
||||||
|
.paste,
|
||||||
=> null,
|
=> null,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -153,6 +153,10 @@ const code_to_key = code_to_key: {
|
|||||||
.{ "Numpad0", .kp_0 },
|
.{ "Numpad0", .kp_0 },
|
||||||
.{ "NumpadDecimal", .kp_decimal },
|
.{ "NumpadDecimal", .kp_decimal },
|
||||||
.{ "NumpadEqual", .kp_equal },
|
.{ "NumpadEqual", .kp_equal },
|
||||||
|
.{ "Undo", .undo },
|
||||||
|
.{ "Cut", .cut },
|
||||||
|
.{ "Copy", .copy },
|
||||||
|
.{ "Paste", .paste },
|
||||||
.{ "ControlLeft", .left_control },
|
.{ "ControlLeft", .left_control },
|
||||||
.{ "ShiftLeft", .left_shift },
|
.{ "ShiftLeft", .left_shift },
|
||||||
.{ "AltLeft", .left_alt },
|
.{ "AltLeft", .left_alt },
|
||||||
|
Reference in New Issue
Block a user