diff options
| author | Teddy Wing | 2018-09-24 18:13:25 +0200 | 
|---|---|---|
| committer | Teddy Wing | 2018-09-24 18:13:25 +0200 | 
| commit | 0dc132e5cbda012dff9faed9a115e2d96c1419af (patch) | |
| tree | a37ed85aa1aecb1427262c16b6faef876553fa69 | |
| parent | d300f69b3486e1c7740848edd19919b133a7b7cd (diff) | |
| download | dome-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.
| -rw-r--r-- | src/cocoa_bridge.rs | 3 | ||||
| -rw-r--r-- | src/lib.rs | 1 | 
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) @@ -1,3 +1,4 @@ +extern crate autopilot;  // extern crate cocoa;  #[macro_use] | 
