mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-14 15:56:13 +03:00
super+v to paste
This commit is contained in:
2
TODO.md
2
TODO.md
@ -17,7 +17,7 @@ Major Features:
|
||||
* History, mouse scrolling
|
||||
* Line wrap
|
||||
* Selection, highlighting
|
||||
* Copy/paste
|
||||
* Copy (paste is done)
|
||||
* Bold
|
||||
* Underline
|
||||
* Strikethrough
|
||||
|
@ -380,7 +380,22 @@ fn keyCallback(
|
||||
defer tracy.end();
|
||||
|
||||
_ = scancode;
|
||||
_ = mods;
|
||||
|
||||
// Paste
|
||||
if (action == .press and mods.super and key == .v) {
|
||||
const data = glfw.getClipboardString() catch |err| {
|
||||
log.warn("error reading clipboard: {}", .{err});
|
||||
return;
|
||||
};
|
||||
|
||||
if (data.len > 0) {
|
||||
const win = window.getUserPointer(Window) orelse return;
|
||||
win.queueWrite(data) catch |err|
|
||||
log.warn("error pasting clipboard: {}", .{err});
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
//log.info("KEY {} {} {} {}", .{ key, scancode, mods, action });
|
||||
if (action == .press or action == .repeat) {
|
||||
|
Reference in New Issue
Block a user