aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib.rs
diff options
context:
space:
mode:
authorTeddy Wing2018-10-11 17:07:04 +0200
committerTeddy Wing2018-10-11 17:07:04 +0200
commitf21fce30bf46105ab805b596de60568f108a59d3 (patch)
treebd74bf58e3f16e34c01bd7ca7329915476adc242 /src/lib.rs
parent18d499d07928a7276d45acaf7b061d4fb2a7e953 (diff)
downloaddome-key-map-f21fce30bf46105ab805b596de60568f108a59d3.tar.bz2
Add a function to send media key events
Media keys (rewind, play/pause, fast forward on Mac function keys) are different from normal keys. These use a different API, and sending events to simulate those keys is different. Here's a first stab at getting something working for posting simulated media key events. This will be used for new special keys in mapping actions. Haven't tested this at all yet, just happy that it finally compiles. Follow the two Stack Overflow answers referenced in the comments (from Albert https://stackoverflow.com/users/133374/albert and Nick Sweeting https://stackoverflow.com/users/2156113/nick-sweeting). Add the `core-graphics` crate to give us access to `CGEvent`, `CGKeyCode`, and related types. Also include some commented `CGKeyCode` definitions for future use.
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 1f57edb..5ce31eb 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -1,10 +1,11 @@
#![recursion_limit="128"]
extern crate autopilot;
-// extern crate cocoa;
+extern crate cocoa;
#[macro_use]
extern crate combine;
+extern crate core_graphics;
extern crate getopts;
extern crate libc;
@@ -15,6 +16,7 @@ extern crate xdg;
mod cocoa_bridge;
mod config;
+mod key_code;
mod parser;
use parser::{Action, HeadphoneButton, MapAction, MapGroup, MapKind};