Skip to main content

TestEventExt

Trait TestEventExt 

Source
pub trait TestEventExt {
    // Required methods
    fn pointer_down(
        &mut self,
        position: Point<Pixels>,
        button: MouseButton,
        cx: &mut App,
    );
    fn pointer_move(
        &mut self,
        position: Point<Pixels>,
        pressed_button: Option<MouseButton>,
        cx: &mut App,
    );
    fn pointer_up(
        &mut self,
        position: Point<Pixels>,
        button: MouseButton,
        cx: &mut App,
    );
    fn change_modifiers(&mut self, modifiers: Modifiers, cx: &mut App);
    fn key_down(&mut self, key: &str, is_held: bool, cx: &mut App);
    fn key_up(&mut self, key: &str, cx: &mut App);
}
Expand description

Step-level pointer, modifier, and keyboard dispatch helpers for tests that inspect intermediate gesture state.

Required Methods§

Source

fn pointer_down( &mut self, position: Point<Pixels>, button: MouseButton, cx: &mut App, )

Dispatches a single mouse-down event at position and completes a frame.

Source

fn pointer_move( &mut self, position: Point<Pixels>, pressed_button: Option<MouseButton>, cx: &mut App, )

Dispatches a single pointer-move event at position with an explicit held button state and completes a frame.

Source

fn pointer_up( &mut self, position: Point<Pixels>, button: MouseButton, cx: &mut App, )

Dispatches a single mouse-up event at position and completes a frame.

Source

fn change_modifiers(&mut self, modifiers: Modifiers, cx: &mut App)

Updates the window’s active modifiers (preserving Caps Lock) and completes a frame.

Source

fn key_down(&mut self, key: &str, is_held: bool, cx: &mut App)

Dispatches a key-down event (optionally with auto-repeat is_held = true) combining any parsed modifiers with the window’s held modifiers.

Source

fn key_up(&mut self, key: &str, cx: &mut App)

Dispatches a matching key-up event combining any parsed modifiers with the window’s held modifiers.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl TestEventExt for Window

Source§

fn pointer_down( &mut self, position: Point<Pixels>, button: MouseButton, cx: &mut App, )

Source§

fn pointer_move( &mut self, position: Point<Pixels>, pressed_button: Option<MouseButton>, cx: &mut App, )

Source§

fn pointer_up( &mut self, position: Point<Pixels>, button: MouseButton, cx: &mut App, )

Source§

fn change_modifiers(&mut self, modifiers: Modifiers, cx: &mut App)

Source§

fn key_down(&mut self, key: &str, is_held: bool, cx: &mut App)

Source§

fn key_up(&mut self, key: &str, cx: &mut App)

Implementors§