Add cursor position implementation on Linux
This commit is contained in:
parent
8afacf4efb
commit
b63e2b2592
|
@ -278,6 +278,12 @@ void delete_string(int32_t count) {
|
|||
}
|
||||
}
|
||||
|
||||
void left_arrow(int32_t count) {
|
||||
for (int i = 0; i<count; i++) {
|
||||
xdo_send_keysequence_window(xdo_context, CURRENTWINDOW, "Left", 8000);
|
||||
}
|
||||
}
|
||||
|
||||
void trigger_paste() {
|
||||
xdo_send_keysequence_window(xdo_context, CURRENTWINDOW, "Control_L+v", 8000);
|
||||
}
|
||||
|
|
|
@ -67,6 +67,11 @@ extern "C" void send_string(const char * string);
|
|||
*/
|
||||
extern "C" void delete_string(int32_t count);
|
||||
|
||||
/*
|
||||
* Send the left arrow keypress, *count* times.
|
||||
*/
|
||||
extern "C" void left_arrow(int32_t count);
|
||||
|
||||
/*
|
||||
* Trigger normal paste ( Pressing CTRL+V )
|
||||
*/
|
||||
|
|
|
@ -39,6 +39,7 @@ extern {
|
|||
|
||||
pub fn send_string(string: *const c_char);
|
||||
pub fn delete_string(count: i32);
|
||||
pub fn left_arrow(count: i32);
|
||||
pub fn trigger_paste();
|
||||
pub fn trigger_terminal_paste();
|
||||
}
|
|
@ -53,4 +53,10 @@ impl super::KeyboardManager for LinuxKeyboardManager {
|
|||
fn delete_string(&self, count: i32) {
|
||||
unsafe {delete_string(count)}
|
||||
}
|
||||
|
||||
fn move_cursor_left(&self, count: i32) {
|
||||
unsafe {
|
||||
left_arrow(count);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user