mirror of
https://github.com/italicsjenga/winit-sonoma-fix.git
synced 2024-12-23 13:51:30 +11:00
bd2f1e8312
Up until now the Android backend has been directly mapping key codes which essentially just represent the "physical" cap of the key (quoted since this also related to virtual keyboards). Since we didn't account for any meta keys either it meant the backend only supported a 1:1 mapping from key codes, which only covers a tiny subset of characters. For example you couldn't type a colon since there's no keycode for that and we didn't try and map Shift+Semicolon into a colon character. This has been tricky to support because the `NativeActivity` class doesn't have direct access to the Java `KeyEvent` object which exposes a more convenient `getUnicodeChar` API. It is now possible to query a `KeyCharcterMap` for the device associated with a `KeyEvent` via the `AndroidApp::device_key_character_map` API which provides a binding to the SDK `KeyCharacterMap` API in Java: https://developer.android.com/reference/android/view/KeyCharacterMap This is effectively what `getUnicodeChar` is implemented based on and is a bit more general purpose. `KeyCharacterMap` lets us map a key_code + meta_state from a `KeyEvent` into either a unicode character or dead key accent that can be combined with the following key. This mapping is done based on the user's chosen layout for the keyboard. To enable support for key character maps the `AndroidApp::input_events()` API was replaced by `AndroidApp::input_events_iter()` which returns a (lending) iterator for events. This was changed because the previous design made it difficult to allow other AndroidApp APIs to be used while iterating events (mainly because AndroidApp held a lock over the backend during iteration)
209 lines
6.4 KiB
TOML
209 lines
6.4 KiB
TOML
[package]
|
|
name = "winit"
|
|
version = "0.29.0-beta.0"
|
|
authors = ["The winit contributors", "Pierre Krieger <pierre.krieger1708@gmail.com>"]
|
|
description = "Cross-platform window creation library."
|
|
edition = "2021"
|
|
keywords = ["windowing"]
|
|
license = "Apache-2.0"
|
|
readme = "README.md"
|
|
repository = "https://github.com/rust-windowing/winit"
|
|
documentation = "https://docs.rs/winit"
|
|
categories = ["gui"]
|
|
rust-version = "1.64.0"
|
|
|
|
[package.metadata.docs.rs]
|
|
features = ["serde"]
|
|
default-target = "x86_64-unknown-linux-gnu"
|
|
# These are all tested in CI
|
|
targets = [
|
|
# Windows
|
|
"i686-pc-windows-msvc",
|
|
"x86_64-pc-windows-msvc",
|
|
# macOS
|
|
"x86_64-apple-darwin",
|
|
# Unix (X11 & Wayland)
|
|
"i686-unknown-linux-gnu",
|
|
"x86_64-unknown-linux-gnu",
|
|
# iOS
|
|
"x86_64-apple-ios",
|
|
# Android
|
|
"aarch64-linux-android",
|
|
# WebAssembly
|
|
"wasm32-unknown-unknown",
|
|
]
|
|
rustdoc-args = ["--cfg", "docsrs"]
|
|
|
|
[features]
|
|
default = ["x11", "wayland", "wayland-dlopen", "wayland-csd-adwaita"]
|
|
x11 = ["x11-dl", "bytemuck", "percent-encoding", "xkbcommon-dl/x11", "x11rb"]
|
|
wayland = ["wayland-client", "wayland-backend", "wayland-protocols", "sctk", "fnv", "memmap2"]
|
|
wayland-dlopen = ["wayland-backend/dlopen"]
|
|
wayland-csd-adwaita = ["sctk-adwaita", "sctk-adwaita/ab_glyph"]
|
|
wayland-csd-adwaita-crossfont = ["sctk-adwaita", "sctk-adwaita/crossfont"]
|
|
wayland-csd-adwaita-notitle = ["sctk-adwaita"]
|
|
android-native-activity = ["android-activity/native-activity"]
|
|
android-game-activity = ["android-activity/game-activity"]
|
|
serde = ["dep:serde", "cursor-icon/serde", "smol_str/serde"]
|
|
|
|
[build-dependencies]
|
|
cfg_aliases = "0.1.1"
|
|
|
|
[dependencies]
|
|
bitflags = "2"
|
|
cursor-icon = "1.0.0"
|
|
log = "0.4"
|
|
mint = { version = "0.5.6", optional = true }
|
|
once_cell = "1.12"
|
|
raw_window_handle = { package = "raw-window-handle", version = "0.5", features = ["std"] }
|
|
serde = { version = "1", optional = true, features = ["serde_derive"] }
|
|
smol_str = "0.2.0"
|
|
|
|
[dev-dependencies]
|
|
image = { version = "0.24.0", default-features = false, features = ["png"] }
|
|
simple_logger = { version = "2.1.0", default_features = false }
|
|
|
|
[target.'cfg(not(any(target_os = "android", target_os = "ios")))'.dev-dependencies]
|
|
softbuffer = "0.3.0"
|
|
|
|
[target.'cfg(target_os = "android")'.dependencies]
|
|
# Coordinate the next winit release android-activity 0.5 release
|
|
android-activity = { git = "https://github.com/rust-mobile/android-activity" }
|
|
ndk = "0.7.0"
|
|
ndk-sys = "0.4.0"
|
|
|
|
[target.'cfg(any(target_os = "ios", target_os = "macos"))'.dependencies]
|
|
core-foundation = "0.9.3"
|
|
objc2 = "0.4.1"
|
|
|
|
[target.'cfg(target_os = "macos")'.dependencies]
|
|
core-graphics = "0.22.3"
|
|
dispatch = "0.2.0"
|
|
|
|
[target.'cfg(target_os = "macos")'.dependencies.icrate]
|
|
version = "0.0.4"
|
|
features = [
|
|
"Foundation",
|
|
"Foundation_NSArray",
|
|
"Foundation_NSAttributedString",
|
|
"Foundation_NSMutableAttributedString",
|
|
"Foundation_NSData",
|
|
"Foundation_NSDictionary",
|
|
"Foundation_NSString",
|
|
"Foundation_NSProcessInfo",
|
|
"Foundation_NSThread",
|
|
"Foundation_NSNumber",
|
|
]
|
|
|
|
[target.'cfg(target_os = "ios")'.dependencies.icrate]
|
|
version = "0.0.4"
|
|
features = [
|
|
"Foundation",
|
|
"Foundation_NSArray",
|
|
"Foundation_NSString",
|
|
"Foundation_NSProcessInfo",
|
|
"Foundation_NSThread",
|
|
"Foundation_NSSet",
|
|
]
|
|
|
|
[target.'cfg(target_os = "windows")'.dependencies]
|
|
unicode-segmentation = "1.7.1"
|
|
|
|
[target.'cfg(target_os = "windows")'.dependencies.windows-sys]
|
|
version = "0.48"
|
|
features = [
|
|
"Win32_Devices_HumanInterfaceDevice",
|
|
"Win32_Foundation",
|
|
"Win32_Globalization",
|
|
"Win32_Graphics_Dwm",
|
|
"Win32_Graphics_Gdi",
|
|
"Win32_Media",
|
|
"Win32_System_Com_StructuredStorage",
|
|
"Win32_System_Com",
|
|
"Win32_System_LibraryLoader",
|
|
"Win32_System_Ole",
|
|
"Win32_System_SystemInformation",
|
|
"Win32_System_SystemServices",
|
|
"Win32_System_Threading",
|
|
"Win32_System_WindowsProgramming",
|
|
"Win32_UI_Accessibility",
|
|
"Win32_UI_Controls",
|
|
"Win32_UI_HiDpi",
|
|
"Win32_UI_Input_Ime",
|
|
"Win32_UI_Input_KeyboardAndMouse",
|
|
"Win32_UI_Input_Pointer",
|
|
"Win32_UI_Input_Touch",
|
|
"Win32_UI_Shell",
|
|
"Win32_UI_TextServices",
|
|
"Win32_UI_WindowsAndMessaging",
|
|
]
|
|
|
|
[target.'cfg(all(unix, not(any(target_os = "redox", target_family = "wasm", target_os = "android", target_os = "ios", target_os = "macos"))))'.dependencies]
|
|
bytemuck = { version = "1.13.1", default-features = false, optional = true }
|
|
libc = "0.2.64"
|
|
percent-encoding = { version = "2.0", optional = true }
|
|
fnv = { version = "1.0.3", optional = true }
|
|
sctk = { package = "smithay-client-toolkit", version = "0.17.0", default-features = false, features = ["calloop"], optional = true }
|
|
sctk-adwaita = { version = "0.6.0", default_features = false, optional = true }
|
|
wayland-client = { version = "0.30.0", optional = true }
|
|
wayland-backend = { version = "0.1.0", default_features = false, features = ["client_system"], optional = true }
|
|
wayland-protocols = { version = "0.30.0", features = [ "staging"], optional = true }
|
|
calloop = "0.10.5"
|
|
rustix = { version = "0.38.4", default-features = false, features = ["std", "system", "thread", "process"] }
|
|
x11-dl = { version = "2.18.5", optional = true }
|
|
x11rb = { version = "0.12.0", default-features = false, features = ["allow-unsafe-code", "dl-libxcb", "xinput", "xkb"], optional = true }
|
|
xkbcommon-dl = "0.4.0"
|
|
memmap2 = { version = "0.5.0", optional = true }
|
|
|
|
[target.'cfg(target_os = "redox")'.dependencies]
|
|
orbclient = { version = "0.3.42", default-features = false }
|
|
redox_syscall = "0.3"
|
|
|
|
[target.'cfg(target_family = "wasm")'.dependencies.web_sys]
|
|
package = "web-sys"
|
|
version = "0.3.64"
|
|
features = [
|
|
'console',
|
|
'CssStyleDeclaration',
|
|
'Document',
|
|
'DomRect',
|
|
'DomRectReadOnly',
|
|
'Element',
|
|
'Event',
|
|
'EventTarget',
|
|
'FocusEvent',
|
|
'HtmlCanvasElement',
|
|
'HtmlElement',
|
|
'IntersectionObserver',
|
|
'IntersectionObserverEntry',
|
|
'KeyboardEvent',
|
|
'MediaQueryList',
|
|
'Node',
|
|
'PageTransitionEvent',
|
|
'PointerEvent',
|
|
'ResizeObserver',
|
|
'ResizeObserverBoxOptions',
|
|
'ResizeObserverEntry',
|
|
'ResizeObserverOptions',
|
|
'ResizeObserverSize',
|
|
'VisibilityState',
|
|
'Window',
|
|
'WheelEvent'
|
|
]
|
|
|
|
[target.'cfg(target_family = "wasm")'.dependencies]
|
|
atomic-waker = "1"
|
|
js-sys = "0.3.64"
|
|
wasm-bindgen = "0.2"
|
|
wasm-bindgen-futures = "0.4"
|
|
web-time = "0.2"
|
|
|
|
[target.'cfg(target_family = "wasm")'.dev-dependencies]
|
|
console_log = "1"
|
|
web-sys = { version = "0.3.22", features = ['CanvasRenderingContext2d'] }
|
|
|
|
[workspace]
|
|
members = [
|
|
"run-wasm",
|
|
]
|