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

@ -1,4 +1,3 @@
use smol_str::SmolStr;
use windows_sys::Win32::Foundation::HWND;
use windows_sys::Win32::UI::WindowsAndMessaging::{HMENU, WINDOW_LONG_PTR_INDEX};
@ -11,7 +10,6 @@ pub(crate) use self::window::Window;
pub(crate) use crate::cursor::OnlyCursorImageSource as PlatformCustomCursorSource;
use crate::event::DeviceId;
use crate::icon::Icon;
use crate::keyboard::Key;
use crate::platform::windows::{BackdropType, Color, CornerPreference};
use crate::platform_impl::Fullscreen;
@ -61,12 +59,6 @@ fn wrap_device_id(id: u32) -> DeviceId {
DeviceId::from_raw(id as i64)
}
#[derive(Debug, Clone, Eq, PartialEq, Hash)]
pub struct KeyEventExtra {
pub text_with_all_modifiers: Option<SmolStr>,
pub key_without_modifiers: Key,
}
#[inline(always)]
const fn get_xbutton_wparam(x: u32) -> u16 {
hiword(x)