mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-15 00:06:09 +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
|
* History, mouse scrolling
|
||||||
* Line wrap
|
* Line wrap
|
||||||
* Selection, highlighting
|
* Selection, highlighting
|
||||||
* Copy/paste
|
* Copy (paste is done)
|
||||||
* Bold
|
* Bold
|
||||||
* Underline
|
* Underline
|
||||||
* Strikethrough
|
* Strikethrough
|
||||||
|
@ -380,7 +380,22 @@ fn keyCallback(
|
|||||||
defer tracy.end();
|
defer tracy.end();
|
||||||
|
|
||||||
_ = scancode;
|
_ = 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 });
|
//log.info("KEY {} {} {} {}", .{ key, scancode, mods, action });
|
||||||
if (action == .press or action == .repeat) {
|
if (action == .press or action == .repeat) {
|
||||||
|
Reference in New Issue
Block a user