servo / core-foundation-rs

Rust bindings to Core Foundation and other low level libraries on Mac OS X and iOS
Other
987 stars 216 forks source link

CGEventKeyboardSetUnicodeString is private #676

Closed Kircheneer closed 4 months ago

Kircheneer commented 4 months ago

I am not sure if maybe I am doing something wrong, but I was trying to get access to the CGEventKeyboardSetUnicodeString function and apparently its private. How can I use this functionality?

9   | use core_graphics::event::CGEventKeyboardSetUnicodeString;
    |                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ private function
    |
note: the function `CGEventKeyboardSetUnicodeString` is defined here
   --> /Users/leo/.cargo/registry/src/index.crates.io-6f17d22bba15001f/core-graphics-0.23.2/src/event.rs:774:5
    |
774 | /     fn CGEventKeyboardSetUnicodeString(
775 | |         event: crate::sys::CGEventRef,
776 | |         length: libc::c_ulong,
777 | |         string: *const u16,
778 | |     );
    | |_____^
Kircheneer commented 4 months ago

I figured it out, I think I am supposed to consume this directly via CGEvent which makes more sense, too.