diff options
Diffstat (limited to 'rsnix/src/ps2.rs')
| -rw-r--r-- | rsnix/src/ps2.rs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/rsnix/src/ps2.rs b/rsnix/src/ps2.rs index 965e4a0..cac476f 100644 --- a/rsnix/src/ps2.rs +++ b/rsnix/src/ps2.rs | |||
| @@ -463,6 +463,26 @@ pub struct MouseEvent { | |||
| 463 | pub middle: bool, | 463 | pub middle: bool, |
| 464 | } | 464 | } |
| 465 | 465 | ||
| 466 | /// What happened in a window-relative (GUI) mouse event. | ||
| 467 | #[derive(Clone, Copy, Debug, PartialEq, Eq)] | ||
| 468 | pub enum MouseKind { | ||
| 469 | Move, | ||
| 470 | Press, | ||
| 471 | Release, | ||
| 472 | } | ||
| 473 | |||
| 474 | /// A mouse event delivered to a focused GUI window: absolute coordinates | ||
| 475 | /// relative to the window's content top-left, the current button bitmask, | ||
| 476 | /// and the action (move / press / release). Unlike `MouseEvent` (relative | ||
| 477 | /// deltas), this is what an app's drawing loop consumes. | ||
| 478 | #[derive(Clone, Copy, Debug)] | ||
| 479 | pub struct AppMouseEvent { | ||
| 480 | pub x: i32, | ||
| 481 | pub y: i32, | ||
| 482 | pub buttons: u8, | ||
| 483 | pub kind: MouseKind, | ||
| 484 | } | ||
| 485 | |||
| 466 | /// Packet assembly state — lives in main context (consumer side), fed by | 486 | /// Packet assembly state — lives in main context (consumer side), fed by |
| 467 | /// the raw byte ring that the IRQ12 handler fills. | 487 | /// the raw byte ring that the IRQ12 handler fills. |
| 468 | struct MouseState { | 488 | struct MouseState { |
