这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@stefnotch
Copy link

Partial fix for #117

It only implements this for Windows.

pub enum MouseScrollDelta {
LineDelta(f32, f32),
// Not supported yet PixelDelta(PhysicalPosition<f64>),
}
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This imitates the Winit API

/// ```
#[cfg(feature = "unstable_grab")]
pub fn grab<T>(callback: T) -> Result<(), GrabError>
pub fn grab<T>(event_types: EventTypes, callback: T) -> Result<(), GrabError>
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a useful optimisation on platforms like Windows.

set_mouse_hook(raw_callback)?;

if event_types.keyboard {
set_key_hook(raw_callback)?;
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Btw, the current keyboard hook can break things.
With my (very custom) keyboard, a few shortcuts do not work if I register this hook.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant