aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs
index 19c2ab7..443acdc 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -1,5 +1,8 @@
+extern crate clipboard;
extern crate rustty;
+use clipboard::ClipboardContext;
+
use rustty::{Terminal, Event, Cell, Color, Attr};
use rustty::ui::Painter;
@@ -23,6 +26,8 @@ fn main() {
let mut selection = Point { x: 0, y: 2 };
+ let mut clipboard_ctx = ClipboardContext::new().unwrap();
+
loop {
term.printline(0, 0, "Passextract (Press q or Ctrl-C to quit)");
@@ -67,6 +72,9 @@ fn main() {
term.set_cursor(selection.x + 2, selection.y).unwrap();
}
}
+ '\x0D' => {
+ clipboard_ctx.set_contents(strip_key(options[selection.y - 3]).to_owned()).unwrap()
+ }
c @ _ => {
}
}