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

@ -6,8 +6,8 @@ use std::sync::Arc;
use web_sys::Element;
use super::super::lock;
use super::super::monitor::MonitorPermissionFuture;
use super::super::{lock, KeyEventExtra};
use super::runner::Event;
use super::{backend, runner};
use crate::application::ApplicationHandler;
@ -140,12 +140,13 @@ impl ActiveEventLoop {
device_id: None,
event: KeyEvent {
physical_key,
logical_key,
text,
logical_key: logical_key.clone(),
text: text.clone(),
location,
state: ElementState::Pressed,
repeat,
platform_specific: KeyEventExtra,
text_with_all_modifiers: text,
key_without_modifiers: logical_key,
},
is_synthetic: false,
},
@ -174,12 +175,13 @@ impl ActiveEventLoop {
device_id: None,
event: KeyEvent {
physical_key,
logical_key,
text,
logical_key: logical_key.clone(),
text: text.clone(),
location,
state: ElementState::Released,
repeat,
platform_specific: KeyEventExtra,
text_with_all_modifiers: text,
key_without_modifiers: logical_key,
},
is_synthetic: false,
},