From 87ca08c0590c0a9a42771b34470115accb617ecc Mon Sep 17 00:00:00 2001 From: Federico Terzi Date: Fri, 29 Nov 2019 22:20:37 +0100 Subject: [PATCH] Add Shift Insert shortcut on Linux backend --- native/liblinuxbridge/bridge.cpp | 6 ++++++ native/liblinuxbridge/bridge.h | 5 +++++ src/bridge/linux.rs | 1 + src/keyboard/linux.rs | 5 ++++- 4 files changed, 16 insertions(+), 1 deletion(-) diff --git a/native/liblinuxbridge/bridge.cpp b/native/liblinuxbridge/bridge.cpp index b757ff4..5695fa3 100644 --- a/native/liblinuxbridge/bridge.cpp +++ b/native/liblinuxbridge/bridge.cpp @@ -299,6 +299,10 @@ void trigger_terminal_paste() { xdo_send_keysequence_window(xdo_context, CURRENTWINDOW, "Control_L+Shift+v", 8000); } +void trigger_shift_ins_paste() { + xdo_send_keysequence_window(xdo_context, CURRENTWINDOW, "Shift+Insert", 8000); +} + // SYSTEM MODULE // Function taken from the wmlib tool source code @@ -470,3 +474,5 @@ int32_t is_current_window_terminal() { return 0; } + + diff --git a/native/liblinuxbridge/bridge.h b/native/liblinuxbridge/bridge.h index 16972eb..9d07122 100644 --- a/native/liblinuxbridge/bridge.h +++ b/native/liblinuxbridge/bridge.h @@ -82,6 +82,11 @@ extern "C" void trigger_paste(); */ extern "C" void trigger_terminal_paste(); +/* + * Trigger shift ins pasting( Pressing SHIFT+INS ) + */ +extern "C" void trigger_shift_ins_paste(); + // SYSTEM MODULE diff --git a/src/bridge/linux.rs b/src/bridge/linux.rs index f93efbb..4947629 100644 --- a/src/bridge/linux.rs +++ b/src/bridge/linux.rs @@ -42,4 +42,5 @@ extern { pub fn left_arrow(count: i32); pub fn trigger_paste(); pub fn trigger_terminal_paste(); + pub fn trigger_shift_ins_paste(); } \ No newline at end of file diff --git a/src/keyboard/linux.rs b/src/keyboard/linux.rs index 1476316..956d89d 100644 --- a/src/keyboard/linux.rs +++ b/src/keyboard/linux.rs @@ -57,7 +57,10 @@ impl super::KeyboardManager for LinuxKeyboardManager { }, PasteShortcut::CtrlShiftV => { trigger_terminal_paste(); - } + }, + PasteShortcut::ShiftInsert=> { + trigger_shift_ins_paste(); + }, _ => { error!("Linux backend does not support this Paste Shortcut, please open an issue on GitHub if you need it.") }