mirror of
https://github.com/feschber/lan-mouse.git
synced 2026-03-20 19:50:55 +03:00
Compare commits
1 Commits
macos-inpu
...
fix-mandat
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1590245963 |
@@ -813,7 +813,7 @@ impl Dispatch<WlPointer, ()> for State {
|
|||||||
})),
|
})),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
wl_pointer::Event::Frame => {
|
wl_pointer::Event::Frame {} => {
|
||||||
// TODO properly handle frame events
|
// TODO properly handle frame events
|
||||||
// we simply insert a frame event on the client side
|
// we simply insert a frame event on the client side
|
||||||
// after each event for now
|
// after each event for now
|
||||||
|
|||||||
@@ -390,9 +390,9 @@ fn create_event_tap<'a>(
|
|||||||
|
|
||||||
if let Some(pos) = pos {
|
if let Some(pos) = pos {
|
||||||
res_events.iter().for_each(|e| {
|
res_events.iter().for_each(|e| {
|
||||||
// error must be ignored, since the event channel
|
event_tx
|
||||||
// may already be closed when the InputCapture instance is dropped.
|
.blocking_send((pos, *e))
|
||||||
let _ = event_tx.blocking_send((pos, *e));
|
.expect("Failed to send event");
|
||||||
});
|
});
|
||||||
// Returning None should stop the event from being processed
|
// Returning None should stop the event from being processed
|
||||||
// but core fundation still returns the event
|
// but core fundation still returns the event
|
||||||
|
|||||||
@@ -22,9 +22,9 @@ use windows::Win32::UI::WindowsAndMessaging::{
|
|||||||
RegisterClassW, SetWindowsHookExW, TranslateMessage, EDD_GET_DEVICE_INTERFACE_NAME, HHOOK,
|
RegisterClassW, SetWindowsHookExW, TranslateMessage, EDD_GET_DEVICE_INTERFACE_NAME, HHOOK,
|
||||||
HMENU, HOOKPROC, KBDLLHOOKSTRUCT, LLKHF_EXTENDED, MSG, MSLLHOOKSTRUCT, WH_KEYBOARD_LL,
|
HMENU, HOOKPROC, KBDLLHOOKSTRUCT, LLKHF_EXTENDED, MSG, MSLLHOOKSTRUCT, WH_KEYBOARD_LL,
|
||||||
WH_MOUSE_LL, WINDOW_STYLE, WM_DISPLAYCHANGE, WM_KEYDOWN, WM_KEYUP, WM_LBUTTONDOWN,
|
WH_MOUSE_LL, WINDOW_STYLE, WM_DISPLAYCHANGE, WM_KEYDOWN, WM_KEYUP, WM_LBUTTONDOWN,
|
||||||
WM_LBUTTONUP, WM_MBUTTONDOWN, WM_MBUTTONUP, WM_MOUSEHWHEEL, WM_MOUSEMOVE, WM_MOUSEWHEEL,
|
WM_LBUTTONUP, WM_MBUTTONDOWN, WM_MBUTTONUP, WM_MOUSEMOVE, WM_MOUSEWHEEL, WM_RBUTTONDOWN,
|
||||||
WM_RBUTTONDOWN, WM_RBUTTONUP, WM_SYSKEYDOWN, WM_SYSKEYUP, WM_USER, WM_XBUTTONDOWN,
|
WM_RBUTTONUP, WM_SYSKEYDOWN, WM_SYSKEYUP, WM_USER, WM_XBUTTONDOWN, WM_XBUTTONUP, WNDCLASSW,
|
||||||
WM_XBUTTONUP, WNDCLASSW, WNDPROC,
|
WNDPROC,
|
||||||
};
|
};
|
||||||
|
|
||||||
use input_event::{
|
use input_event::{
|
||||||
@@ -537,10 +537,6 @@ fn to_mouse_event(wparam: WPARAM, lparam: LPARAM) -> Option<PointerEvent> {
|
|||||||
state: if p == WM_XBUTTONDOWN as usize { 1 } else { 0 },
|
state: if p == WM_XBUTTONDOWN as usize { 1 } else { 0 },
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
WPARAM(p) if p == WM_MOUSEHWHEEL as usize => Some(PointerEvent::AxisDiscrete120 {
|
|
||||||
axis: 1, // Horizontal
|
|
||||||
value: mouse_low_level.mouseData as i32 >> 16,
|
|
||||||
}),
|
|
||||||
w => {
|
w => {
|
||||||
log::warn!("unknown mouse event: {w:?}");
|
log::warn!("unknown mouse event: {w:?}");
|
||||||
None
|
None
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ impl X11Emulation {
|
|||||||
pub(crate) fn new() -> Result<Self, X11EmulationCreationError> {
|
pub(crate) fn new() -> Result<Self, X11EmulationCreationError> {
|
||||||
let display = unsafe {
|
let display = unsafe {
|
||||||
match xlib::XOpenDisplay(ptr::null()) {
|
match xlib::XOpenDisplay(ptr::null()) {
|
||||||
d if std::ptr::eq(d, ptr::null_mut::<xlib::Display>()) => {
|
d if d == ptr::null::<xlib::Display>() as *mut xlib::Display => {
|
||||||
Err(X11EmulationCreationError::OpenDisplay)
|
Err(X11EmulationCreationError::OpenDisplay)
|
||||||
}
|
}
|
||||||
display => Ok(display),
|
display => Ok(display),
|
||||||
|
|||||||
@@ -143,6 +143,7 @@ impl Emulation for DesktopPortalEmulation<'_> {
|
|||||||
|
|
||||||
impl AsyncDrop for DesktopPortalEmulation<'_> {
|
impl AsyncDrop for DesktopPortalEmulation<'_> {
|
||||||
#[doc = r" Perform the async cleanup."]
|
#[doc = r" Perform the async cleanup."]
|
||||||
|
#[must_use]
|
||||||
#[allow(clippy::type_complexity, clippy::type_repetition_in_bounds)]
|
#[allow(clippy::type_complexity, clippy::type_repetition_in_bounds)]
|
||||||
fn async_drop<'async_trait>(
|
fn async_drop<'async_trait>(
|
||||||
self,
|
self,
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ use super::KeyObject;
|
|||||||
|
|
||||||
glib::wrapper! {
|
glib::wrapper! {
|
||||||
pub struct KeyRow(ObjectSubclass<imp::KeyRow>)
|
pub struct KeyRow(ObjectSubclass<imp::KeyRow>)
|
||||||
@extends gtk::ListBoxRow, gtk::Widget, adw::PreferencesRow, adw::ActionRow,
|
@extends gtk::ListBoxRow, gtk::Widget, adw::PreferencesRow, adw::ExpanderRow,
|
||||||
@implements gtk::Accessible, gtk::Actionable, gtk::Buildable, gtk::ConstraintTarget;
|
@implements gtk::Accessible, gtk::Actionable, gtk::Buildable, gtk::ConstraintTarget;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user