Merge KeyEventExtra into KeyEvent (#4029)

To make the fields easier to use, and to allow constructing KeyEvent in
user test code.
This commit is contained in:
Mads Marquart 2025-02-26 17:51:49 +01:00 committed by GitHub
parent 6c0e3c3b15
commit 0c89ea7386
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
19 changed files with 71 additions and 135 deletions

View file

@ -9,8 +9,6 @@ use std::time::Duration;
#[cfg(x11_platform)]
use std::{ffi::CStr, mem::MaybeUninit, os::raw::*, sync::Arc, sync::Mutex};
use smol_str::SmolStr;
pub(crate) use self::common::xkb::{physicalkey_to_scancode, scancode_to_physicalkey};
#[cfg(x11_platform)]
use self::x11::{XConnection, XError, XNotSupported};
@ -22,7 +20,6 @@ use crate::dpi::Size;
use crate::error::{EventLoopError, NotSupportedError};
use crate::event_loop::ActiveEventLoop;
pub(crate) use crate::icon::RgbaIcon as PlatformIcon;
use crate::keyboard::Key;
use crate::monitor::VideoMode;
use crate::platform::pump_events::PumpStatus;
#[cfg(x11_platform)]
@ -175,12 +172,6 @@ impl MonitorHandle {
}
}
#[derive(Debug, Clone, Eq, PartialEq, Hash)]
pub struct KeyEventExtra {
pub text_with_all_modifiers: Option<SmolStr>,
pub key_without_modifiers: Key,
}
#[derive(Clone, Debug, Eq, Hash, PartialEq)]
pub(crate) enum PlatformCustomCursor {
#[cfg(wayland_platform)]