pub struct CGEvent(/* private fields */);Implementations§
Source§impl CGEvent
impl CGEvent
pub fn new(source: CGEventSource) -> Option<CGEvent>
pub fn new_data(&self) -> Option<CFData>
pub fn new_mouse_event( source: CGEventSource, mouse_type: CGEventType, cursor_position: CGPoint, button: CGMouseButton, ) -> Option<CGEvent>
pub fn new_keyboard_event( source: CGEventSource, keycode: CGKeyCode, keydown: bool, ) -> Option<CGEvent>
pub fn new_scroll_event( source: CGEventSource, units: CGScrollEventUnit, wheel_count: u32, wheel1: i32, wheel2: i32, wheel3: i32, ) -> Option<CGEvent>
pub fn new_copy(&self) -> Option<CGEvent>
pub fn new_source(&self) -> Option<CGEventSource>
pub fn from_data(data: CFData) -> Option<CGEvent>
pub fn set_source(&self, source: CGEventSource)
pub fn get_type(&self) -> CGEventType
pub fn set_type(&self, event_type: CGEventType)
pub fn get_timestamp(&self) -> CGEventTimestamp
pub fn set_timestamp(&self, timestamp: CGEventTimestamp)
pub fn get_location(&self) -> CGPoint
pub fn get_unflipped_location(&self) -> CGPoint
pub fn set_location(&self, location: CGPoint)
pub fn get_flags(&self) -> CGEventFlags
pub fn set_flags(&self, flags: CGEventFlags)
pub fn get_integer_value_field(&self, field: CGEventField) -> i64
pub fn set_integer_value_field(&self, field: CGEventField, value: i64)
pub fn get_double_value_field(&self, field: CGEventField) -> f64
pub fn set_double_value_field(&self, field: CGEventField, value: f64)
pub fn set_string(&self, string: &str)
pub fn post(&self, tap: CGEventTapLocation)
pub fn post_to_pid(&self, pid: pid_t)
pub fn post_from_tap(&self, proxy: CGEventTapProxy)
Trait Implementations§
Source§impl TCFType for CGEvent
impl TCFType for CGEvent
Source§fn as_concrete_TypeRef(&self) -> CGEventRef
fn as_concrete_TypeRef(&self) -> CGEventRef
Returns the object as its concrete
TypeRef.Source§unsafe fn wrap_under_get_rule(reference: CGEventRef) -> Self
unsafe fn wrap_under_get_rule(reference: CGEventRef) -> Self
Returns an instance of the object, wrapping the underlying
CFTypeRef subclass. Use this
when following Core Foundation’s “Get Rule”. The reference count is bumped.Source§fn as_CFTypeRef(&self) -> CFTypeRef
fn as_CFTypeRef(&self) -> CFTypeRef
Returns the object as a raw
CFTypeRef. The reference count is not adjusted.Source§unsafe fn wrap_under_create_rule(reference: CGEventRef) -> Self
unsafe fn wrap_under_create_rule(reference: CGEventRef) -> Self
Returns an instance of the object, wrapping the underlying
CFTypeRef subclass. Use this
when following Core Foundation’s “Create Rule”. The reference count is not bumped.Source§fn as_CFType(&self) -> CFType
fn as_CFType(&self) -> CFType
Returns the object as a wrapped
CFType. The reference count is incremented by one.Source§fn into_CFType(self) -> CFTypewhere
Self: Sized,
fn into_CFType(self) -> CFTypewhere
Self: Sized,
Returns the object as a wrapped
CFType. Consumes self and avoids changing the reference
count.Source§fn retain_count(&self) -> isize
fn retain_count(&self) -> isize
Returns the reference count of the object. It is unwise to do anything other than test
whether the return value of this method is greater than zero.
Source§fn instance_of<OtherCFType>(&self) -> boolwhere
OtherCFType: TCFType,
fn instance_of<OtherCFType>(&self) -> boolwhere
OtherCFType: TCFType,
Returns
true if this value is an instance of another type.impl ConcreteCFType for CGEvent
impl Eq for CGEvent
Auto Trait Implementations§
impl Freeze for CGEvent
impl RefUnwindSafe for CGEvent
impl !Send for CGEvent
impl !Sync for CGEvent
impl Unpin for CGEvent
impl UnwindSafe for CGEvent
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more