[][src]Enum penrose::core::xconnection::XEvent

pub enum XEvent {
    ButtonPress,
    ButtonRelease,
    KeyPress {
        code: KeyCode,
    },
    MapRequest {
        id: WinId,
        ignore: bool,
    },
    Enter {
        id: WinId,
        rpt: Point,
        wpt: Point,
    },
    Leave {
        id: WinId,
        rpt: Point,
        wpt: Point,
    },
    FocusIn {
        id: WinId,
    },
    FocusOut {
        id: WinId,
    },
    Destroy {
        id: WinId,
    },
    ScreenChange,
    RandrNotify,
    PropertyNotify {
        id: WinId,
        atom: String,
        is_root: bool,
    },
}

Wrapper around the low level XCB event types that require casting to work with. Not all event fields are extracted so check the XCB documentation and update accordingly if you need access to something that isn't currently passed through to the WindowManager event loop.

https://tronche.com/gui/x/xlib/events/types.html https://github.com/rtbo/rust-xcb/xml/xproto.xml

XCB Level events

MapNotify - a window was mapped

  • event (WinId): The window which was mapped or its parent, depending on whether StructureNotify or SubstructureNotify was selected.
  • window (WinId): The window that was mapped.
  • override_redirect (bool): We should ignore this window if true

UnmapNotify - a window was unmapped

  • event (WinId): The window which was unmapped or its parent, depending on whether StructureNotify or SubstructureNotify was selected.
  • window (WinId): The window that was unmapped.
  • from-configure (bool):
    • 'true' if the event was generated as a result of a resizing of the window's parent when window had a win_gravity of UnmapGravity.

EnterNotify - the pointer is now in a different window

  • event (WinId): The window on which the event was generated.
  • child (WinId): If the window has sub-windows then this is the ID of the window that the pointer ended on, XCB_WINDOW_NONE otherwise.
  • root (WinId): The root window for the final cursor position.
  • root-x, root-y (i16, i16): The coordinates of the pointer relative to 'root's origin.
  • event-x, event-y (i16, i16): The coordinates of the pointer relative to the event window's origin.
  • mode (NotifyMode enum)
    • Normal, Grab, Ungrab, WhileGrabbed

LeaveNotify - the pointer has left a window

  • Same fields as EnterNotify

DestroyNotify - a window has been destroyed

  • event (WinId): The reconfigured window or its parent, depending on whether StructureNotify or SubstructureNotify was selected.
  • window (WinId): The window that was destroyed.

KeyPress - a keyboard key was pressed / released

  • detail (u8): Keycode of the key that was pressed
  • event (u16): The modifier masks being held when the key was pressed
  • child (WinId): If the window has sub-windows then this is the ID of the window that the pointer ended on, XCB_WINDOW_NONE otherwise.
  • root (WinId): The root window for the final cursor position.
  • root-x, root-y (i16, i16): The coordinates of the pointer relative to 'root's origin.
  • event-x, event-y (i16, i16): The coordinates of the pointer relative to the event window's origin.

ButtonPress - a mouse button was pressed

  • detail (u8): The button that was pressed
  • event (u16): The modifier masks being held when the button was pressed
  • child (WinId): If the window has sub-windows then this is the ID of the window that the pointer ended on, XCB_WINDOW_NONE otherwise.
  • root (WinId): The root window for the final cursor position.
  • root-x, root-y (i16, i16): The coordinates of the pointer relative to 'root's origin.
  • event-x, event-y (i16, i16): The coordinates of the pointer relative to the event window's origin.

ButtonRelease - a mouse button was released

  • same fields as ButtonPress

Variants

ButtonPress

xcb docs: https://www.mankier.com/3/xcb_input_raw_button_press_event_t

ButtonRelease

xcb docs: https://www.mankier.com/3/xcb_input_raw_button_press_event_t

KeyPress

xcb docs: https://www.mankier.com/3/xcb_input_device_key_press_event_t

Fields of KeyPress

code: KeyCode

The X11 key code that was received along with any modifiers that were held

MapRequest

xcb docs: https://www.mankier.com/3/xcb_map_request_event_t

Fields of MapRequest

id: WinId

The ID of the window that wants to be mapped

ignore: bool

Whether or not the WindowManager should handle this window.

Enter

xcb docs: https://www.mankier.com/3/xcb_enter_notify_event_t

Fields of Enter

id: WinId

The ID of the window that was entered

rpt: Point

Absolute coordinate of the event

wpt: Point

Coordinate of the event relative to top-left of the window itself

Leave

xcb docs: https://www.mankier.com/3/xcb_enter_notify_event_t

Fields of Leave

id: WinId

The ID of the window that was left

rpt: Point

Absolute coordinate of the event

wpt: Point

Coordinate of the event relative to top-left of the window itself

FocusIn

xcb docs: https://www.mankier.com/3/xcb_focus_in_event_t

Fields of FocusIn

id: WinId

The ID of the window that gained focus

FocusOut

xcb docs: https://www.mankier.com/3/xcb_focus_out_event_t

Fields of FocusOut

id: WinId

The ID of the window that lost focus

Destroy

MapNotifyEvent xcb docs: https://www.mankier.com/3/xcb_destroy_notify_event_t

Fields of Destroy

id: WinId

The ID of the window being destroyed

ScreenChange

xcb docs: https://www.mankier.com/3/xcb_randr_screen_change_notify_event_t

RandrNotify

xcb docs: https://www.mankier.com/3/xcb_randr_notify_event_t

PropertyNotify

xcb docs: https://www.mankier.com/3/xcb_property_notify_event_t

Fields of PropertyNotify

id: WinId

The ID of the window that had a property changed

atom: String

The property that changed

is_root: bool

Is this window the root window?

Trait Implementations

impl Clone for XEvent[src]

impl Debug for XEvent[src]

Auto Trait Implementations

impl RefUnwindSafe for XEvent

impl Send for XEvent

impl Sync for XEvent

impl Unpin for XEvent

impl UnwindSafe for XEvent

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.