diff options
| author | Teddy Wing | 2018-10-13 18:35:28 +0200 |
|---|---|---|
| committer | Teddy Wing | 2018-10-13 18:35:28 +0200 |
| commit | d5082eeca37a938e8aa90868cb7c5bae11386601 (patch) | |
| tree | 7d808c09d56f4474f09e28d18efce8eda9cedd47 /src/lib.rs | |
| parent | d57787a8f45e173a19106c7d3d0140d0ac6a7d46 (diff) | |
| download | dome-key-map-d5082eeca37a938e8aa90868cb7c5bae11386601.tar.bz2 | |
Try to send media key events using `NSEvent` and `CGevent`
Segfaults on key_code.rs:184:
error: process didn't exit successfully: `.../dome-key-map/target/debug/deps/dome_key_map-0efa5c8428fad354 send_media_key --nocapture` (signal: 11, SIGSEGV: invalid memory reference)
shell returned 101
This is my attempt to use first the 'cocoa' and 'core-graphics' crates,
then the 'objc' crate (because I hoped that would get around the
segfault), to simulate a media key event.
Once I got the types right and the code compiling, I couldn't get past
segfaults. After struggling with this for over a day and not being able
to figure out what on earth is going on, I wrote the exact same thing in
Objective-C and it just worked. That's it, I'm done with this. This code
is going to be expunged and I'm going to take a C function pointer in
the function that runs map actions that will simulate media key presses
in real Cocoa/Carbon. Enough of this headache.
Diffstat (limited to 'src/lib.rs')
| -rw-r--r-- | src/lib.rs | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -6,11 +6,15 @@ extern crate cocoa; #[macro_use] extern crate combine; extern crate core_graphics; +extern crate foreign_types; extern crate getopts; extern crate libc; #[macro_use] extern crate log; + +#[macro_use] +extern crate objc; extern crate stderrlog; extern crate xdg; |
