aboutsummaryrefslogtreecommitdiffstats
path: root/src/cocoa_bridge.rs
diff options
context:
space:
mode:
authorTeddy Wing2018-10-03 12:42:00 +0200
committerTeddy Wing2018-10-03 12:42:00 +0200
commit52398f0c8507fdb5fe4a680bbbb841232b396ae7 (patch)
treec26b505bf055447dad60ed52cf2a6cd549d4bcec /src/cocoa_bridge.rs
parent7b040a5f3c8f66a2fd95bc1baccfa4fa2885425d (diff)
downloaddome-key-map-52398f0c8507fdb5fe4a680bbbb841232b396ae7.tar.bz2
run_key_action_for_mode(): Tap keys using `KeyboardKeyWithModifiers`
Use `autopilot::key::tap()` to simulate each key and modifier in an action. Originally tried to do this using a method that takes a closure to access the `KeyCodeConvertible` types inside `KeyboardKey`. Ended up with a much cleaner API solution that only requires a single method call.
Diffstat (limited to 'src/cocoa_bridge.rs')
-rw-r--r--src/cocoa_bridge.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/cocoa_bridge.rs b/src/cocoa_bridge.rs
index 68a8515..c2e493b 100644
--- a/src/cocoa_bridge.rs
+++ b/src/cocoa_bridge.rs
@@ -300,6 +300,12 @@ mode <play><up> {
.with_action(s)
.in_mode(trigger)
)
+ } else if let Action::Map(action) = &map.action {
+ for key in action {
+ key.tap()
+ }
+
+ None
} else {
None
}
@@ -327,6 +333,12 @@ mode <play><up> {
KeyActionResult::new(ActionKind::Map)
.with_action(s)
)
+ } else if let Action::Map(action) = &map.action {
+ for key in action {
+ key.tap()
+ }
+
+ None
} else {
None
}