Struct winit::platform_impl::linux::x11::event_processor::EventProcessor
source · pub struct EventProcessor {Show 17 fields
pub dnd: Dnd,
pub ime_receiver: Receiver<ImeRequest>,
pub ime_event_receiver: Receiver<(Window, ImeEvent)>,
pub randr_event_offset: u8,
pub devices: RefCell<HashMap<DeviceId, Device>>,
pub xi2ext: ExtensionInformation,
pub xkbext: ExtensionInformation,
pub target: ActiveEventLoop,
pub xkb_context: Context,
pub num_touch: u32,
pub held_key_press: Option<u32>,
pub first_touch: Option<u64>,
pub active_window: Option<Window>,
pub modifiers: Cell<ModifiersState>,
pub xfiltered_modifiers: VecDeque<c_ulong>,
pub xmodmap: ModifierKeymap,
pub is_composing: bool,
}
Fields§
§dnd: Dnd
§ime_receiver: Receiver<ImeRequest>
§ime_event_receiver: Receiver<(Window, ImeEvent)>
§randr_event_offset: u8
§devices: RefCell<HashMap<DeviceId, Device>>
§xi2ext: ExtensionInformation
§xkbext: ExtensionInformation
§target: ActiveEventLoop
§xkb_context: Context
§num_touch: u32
§held_key_press: Option<u32>
§first_touch: Option<u64>
§active_window: Option<Window>
§modifiers: Cell<ModifiersState>
Latest modifiers we’ve sent for the user to trigger change in event.
xfiltered_modifiers: VecDeque<c_ulong>
§xmodmap: ModifierKeymap
§is_composing: bool
Implementations§
source§impl EventProcessor
impl EventProcessor
pub fn process_event<T: 'static, F>(&mut self, xev: &mut XEvent, callback: F)
sourcefn filter_event(&mut self, xev: &mut XEvent) -> bool
fn filter_event(&mut self, xev: &mut XEvent) -> bool
XFilterEvent tells us when an event has been discarded by the input method. Specifically, this involves all of the KeyPress events in compose/pre-edit sequences, along with an extra copy of the KeyRelease events. This also prevents backspace and arrow keys from being detected twice.
fn process_xevent<T: 'static, F>(&mut self, xev: &mut XEvent, callback: F)
pub fn poll(&self) -> bool
pub unsafe fn poll_one_event(&mut self, event_ptr: *mut XEvent) -> bool
pub fn init_device(&self, device: DeviceId)
pub fn with_window<F, Ret>(&self, window_id: Window, callback: F) -> Option<Ret>
sourcepub fn window_target(window_target: &RootAEL) -> &ActiveEventLoop
pub fn window_target(window_target: &RootAEL) -> &ActiveEventLoop
Get the platform window target.
sourcepub fn window_target_mut(window_target: &mut RootAEL) -> &mut ActiveEventLoop
pub fn window_target_mut(window_target: &mut RootAEL) -> &mut ActiveEventLoop
Get the platform window target.
fn client_message<T: 'static, F>( &mut self, xev: &XClientMessageEvent, callback: F, )
fn selection_notify<T: 'static, F>( &mut self, xev: &XSelectionEvent, callback: F, )
fn configure_notify<T: 'static, F>(&self, xev: &XConfigureEvent, callback: F)
sourcefn reparent_notify(&self, xev: &XReparentEvent)
fn reparent_notify(&self, xev: &XReparentEvent)
This is generally a reliable way to detect when the window manager’s been replaced, though this event is only fired by reparenting window managers (which is almost all of them). Failing to correctly update WM info doesn’t really have much impact, since on the WMs affected (xmonad, dwm, etc.) the only effect is that we waste some time trying to query unsupported properties.
fn map_notify<T: 'static, F>(&self, xev: &XMapEvent, callback: F)
fn destroy_notify<T: 'static, F>(&self, xev: &XDestroyWindowEvent, callback: F)
fn property_notify<T: 'static, F>(&mut self, xev: &XPropertyEvent, callback: F)
fn visibility_notify<T: 'static, F>(&self, xev: &XVisibilityEvent, callback: F)
fn expose<T: 'static, F>(&self, xev: &XExposeEvent, callback: F)
fn xinput_key_input<T: 'static, F>( &mut self, xev: &mut XKeyEvent, state: ElementState, callback: F, )
fn send_synthic_modifier_from_core<T: 'static, F>( &mut self, window_id: WindowId, state: u16, callback: F, )
fn xinput2_mouse_motion<T: 'static, F>( &self, event: &XIDeviceEvent, callback: F, )
fn xinput2_mouse_enter<T: 'static, F>(&self, event: &XIEnterEvent, callback: F)
fn xinput2_mouse_left<T: 'static, F>(&self, event: &XILeaveEvent, callback: F)
fn xinput2_focused<T: 'static, F>(&mut self, xev: &XIFocusInEvent, callback: F)
fn xinput2_unfocused<T: 'static, F>( &mut self, xev: &XIFocusOutEvent, callback: F, )
fn xinput2_touch<T: 'static, F>( &mut self, xev: &XIDeviceEvent, phase: TouchPhase, callback: F, )
fn xinput2_raw_mouse_motion<T: 'static, F>(&self, xev: &XIRawEvent, callback: F)
fn xinput2_raw_key_input<T: 'static, F>( &mut self, xev: &XIRawEvent, state: ElementState, callback: F, )
fn xinput2_hierarchy_changed<T: 'static, F>( &mut self, xev: &XIHierarchyEvent, callback: F, )
fn xkb_event<T: 'static, F>(&mut self, xev: &XkbAnyEvent, callback: F)
pub fn update_mods_from_xinput2_event<T: 'static, F>( &mut self, mods: &XIModifierState, group: &XIModifierState, force: bool, callback: F, )
fn update_mods_from_query<T: 'static, F>( &mut self, window_id: WindowId, callback: F, )
pub fn update_mods_from_core_event<T: 'static, F>( &mut self, window_id: WindowId, state: u16, callback: F, )
pub fn core_keyboard_group(state: u16) -> u32
pub fn xkb_mod_mask_from_core(&mut self, state: u16) -> xkb_mod_mask_t
sourcefn send_modifiers<T: 'static, F: FnMut(&RootAEL, Event<T>)>(
&self,
window_id: WindowId,
modifiers: ModifiersState,
force: bool,
callback: &mut F,
)
fn send_modifiers<T: 'static, F: FnMut(&RootAEL, Event<T>)>( &self, window_id: WindowId, modifiers: ModifiersState, force: bool, callback: &mut F, )
Send modifiers for the active window.
The event won’t be sent when the modifiers
match the previously sent
modifiers value,
unless force
is passed. The force
should be passed when the active window changes.
fn handle_pressed_keys<T: 'static, F>( target: &RootAEL, window_id: WindowId, state: ElementState, xkb_context: &mut Context, callback: &mut F, )
fn process_dpi_change<T: 'static, F>(&self, callback: &mut F)
fn window_exists(&self, window_id: Window) -> bool
Auto Trait Implementations§
impl !Freeze for EventProcessor
impl !RefUnwindSafe for EventProcessor
impl !Send for EventProcessor
impl !Sync for EventProcessor
impl Unpin for EventProcessor
impl !UnwindSafe for EventProcessor
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
source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.