File tree 1 file changed +14
-0
lines changed 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -659,6 +659,12 @@ impl CGEvent {
659
659
unsafe { CGEventGetLocation ( self . as_ptr ( ) ) }
660
660
}
661
661
662
+ pub fn set_location ( & self , location : CGPoint ) {
663
+ unsafe {
664
+ CGEventSetLocation ( self . as_ptr ( ) , location) ;
665
+ }
666
+ }
667
+
662
668
#[ cfg( feature = "elcapitan" ) ]
663
669
pub fn post_to_pid ( & self , pid : libc:: pid_t ) {
664
670
unsafe {
@@ -866,6 +872,14 @@ extern "C" {
866
872
userInfo : * const c_void ,
867
873
) -> CFMachPortRef ;
868
874
875
+ /// Enable or disable an event tap.
876
+ ///
877
+ /// Event taps are normally enabled when created. If an event tap becomes
878
+ /// unresponsive, or if a user requests that event taps be disabled, then
879
+ /// a `kCGEventTapDisabled` event is passed to the event tap callback
880
+ /// function. Event taps may be re-enabled by calling this function.
869
881
fn CGEventTapEnable ( tap : CFMachPortRef , enable : bool ) ;
870
882
883
+ /// Set the location of a mouse event.
884
+ fn CGEventSetLocation ( event : crate :: sys:: CGEventRef , location : CGPoint ) ;
871
885
}
You can’t perform that action at this time.
0 commit comments