aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTeddy Wing2018-09-24 18:13:25 +0200
committerTeddy Wing2018-09-24 18:13:25 +0200
commit0dc132e5cbda012dff9faed9a115e2d96c1419af (patch)
treea37ed85aa1aecb1427262c16b6faef876553fa69 /src
parentd300f69b3486e1c7740848edd19919b133a7b7cd (diff)
downloaddome-key-map-0dc132e5cbda012dff9faed9a115e2d96c1419af.tar.bz2
run_key_action_for_mode(): Simulate key press on `map` type action
For now this is just a test and doesn't handle modifier keys. Just trying to see if 'autopilot' will work.
Diffstat (limited to 'src')
-rw-r--r--src/cocoa_bridge.rs3
-rw-r--r--src/lib.rs1
2 files changed, 4 insertions, 0 deletions
diff --git a/src/cocoa_bridge.rs b/src/cocoa_bridge.rs
index 5f6cee7..6e1a41b 100644
--- a/src/cocoa_bridge.rs
+++ b/src/cocoa_bridge.rs
@@ -3,6 +3,7 @@ use std::mem;
use std::ptr;
use std::slice;
+use autopilot::key::type_string;
// use cocoa::base::nil;
// use cocoa::foundation::{NSArray, NSAutoreleasePool, NSDictionary};
use libc::{c_char, size_t};
@@ -258,6 +259,8 @@ mode <play><up> {
if let Some(map) = map {
return match map.kind {
MapKind::Map => {
+ type_string(&map.action, &[], 0.0, 0.0);
+
Some(
KeyActionResult::new(ActionKind::Map)
.with_action(&map.action)
diff --git a/src/lib.rs b/src/lib.rs
index 3124178..cac0f9b 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -1,3 +1,4 @@
+extern crate autopilot;
// extern crate cocoa;
#[macro_use]