add patches
This commit is contained in:
parent
a6f4b5ac0a
commit
0ee56eecfb
5 changed files with 189 additions and 0 deletions
55
patches/iced_winit.patch
Normal file
55
patches/iced_winit.patch
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
--- iced-o/winit/src/conversion.rs 2025-04-23 13:38:47.125962653 +0200
|
||||
+++ iced/winit/src/conversion.rs 2025-04-23 13:42:51.660061924 +0200
|
||||
@@ -203,13 +203,19 @@
|
||||
WindowEvent::KeyboardInput { is_synthetic, .. } if is_synthetic => None,
|
||||
WindowEvent::KeyboardInput { event, .. } => Some(Event::Keyboard({
|
||||
let key = {
|
||||
- #[cfg(not(target_arch = "wasm32"))]
|
||||
+ #[cfg(not(any(
|
||||
+ target_arch = "wasm32",
|
||||
+ target_os = "android",
|
||||
+ )))]
|
||||
{
|
||||
use winit::platform::modifier_supplement::KeyEventExtModifierSupplement;
|
||||
event.key_without_modifiers()
|
||||
}
|
||||
|
||||
- #[cfg(target_arch = "wasm32")]
|
||||
+ #[cfg(any(
|
||||
+ target_arch = "wasm32",
|
||||
+ target_os = "android",
|
||||
+ ))]
|
||||
{
|
||||
// TODO: Fix inconsistent API on Wasm
|
||||
event.logical_key.clone()
|
||||
@@ -217,7 +223,10 @@
|
||||
};
|
||||
|
||||
let text = {
|
||||
- #[cfg(not(target_arch = "wasm32"))]
|
||||
+ #[cfg(not(any(
|
||||
+ target_arch = "wasm32",
|
||||
+ target_os = "android",
|
||||
+ )))]
|
||||
{
|
||||
use crate::core::SmolStr;
|
||||
use winit::platform::modifier_supplement::KeyEventExtModifierSupplement;
|
||||
@@ -225,6 +234,18 @@
|
||||
event.text_with_all_modifiers().map(SmolStr::new)
|
||||
}
|
||||
|
||||
+ #[cfg(target_os = "android")]
|
||||
+ {
|
||||
+ if event.text.is_some() {
|
||||
+ event.text
|
||||
+ } else {
|
||||
+ match &key {
|
||||
+ winit::keyboard::Key::Character(c) => Some(c.clone()),
|
||||
+ _ => None,
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
#[cfg(target_arch = "wasm32")]
|
||||
{
|
||||
// TODO: Fix inconsistent API on Wasm
|
||||
Loading…
Add table
Add a link
Reference in a new issue