Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update winit to 0.29 #2169

Merged
merged 18 commits into from
Jan 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/audit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ jobs:
- name: Delete `web-sys` dependency from `integration` example
run: sed -i '$d' examples/integration/Cargo.toml
- name: Find outdated dependencies
run: cargo outdated --workspace --exit-code 1
run: cargo outdated --workspace --exit-code 1 --ignore raw-window-handle
2 changes: 1 addition & 1 deletion .github/workflows/document.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
steps:
- uses: hecrj/setup-rust-action@v1
with:
rust-version: nightly
rust-version: nightly-2023-12-11
- uses: actions/checkout@v2
- name: Generate documentation
run: |
Expand Down
5 changes: 3 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ glyphon = "0.4"
guillotiere = "0.6"
half = "2.2"
image = "0.24"
instant = "0.1"
kamadak-exif = "0.5"
kurbo = "0.9"
log = "0.4"
Expand All @@ -145,6 +144,7 @@ raw-window-handle = "0.5"
resvg = "0.36"
rustc-hash = "1.0"
smol = "1.0"
smol_str = "0.2"
softbuffer = "0.2"
syntect = "5.1"
sysinfo = "0.28"
Expand All @@ -157,7 +157,8 @@ unicode-segmentation = "1.0"
wasm-bindgen-futures = "0.4"
wasm-timer = "0.2"
web-sys = "0.3"
web-time = "0.2"
wgpu = "0.18"
winapi = "0.3"
window_clipboard = "0.3"
winit = { git = "https://github.com/iced-rs/winit.git", rev = "c52db2045d0a2f1b8d9923870de1d4ab1994146e", default-features = false }
winit = { git = "https://github.com/iced-rs/winit.git", rev = "b91e39ece2c0d378c3b80da7f3ab50e17bb798a5", features = ["rwh_05"] }
10 changes: 5 additions & 5 deletions core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,18 @@ keywords.workspace = true
[dependencies]
bitflags.workspace = true
log.workspace = true
num-traits.workspace = true
smol_str.workspace = true
thiserror.workspace = true
web-time.workspace = true
xxhash-rust.workspace = true
num-traits.workspace = true

palette.workspace = true
palette.optional = true

[target.'cfg(target_arch = "wasm32")'.dependencies]
instant.workspace = true

[target.'cfg(windows)'.dependencies]
raw-window-handle.workspace = true
# TODO: Use `workspace` dependency once `wgpu` upgrades `raw-window-handle`
raw-window-handle = "0.6"

[dev-dependencies]
approx = "0.5"
7 changes: 5 additions & 2 deletions core/src/keyboard.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
//! Listen to keyboard events.
pub mod key;

mod event;
mod key_code;
mod location;
mod modifiers;

pub use event::Event;
pub use key_code::KeyCode;
pub use key::Key;
pub use location::Location;
pub use modifiers::Modifiers;
29 changes: 18 additions & 11 deletions core/src/keyboard/event.rs
Original file line number Diff line number Diff line change
@@ -1,34 +1,41 @@
use super::{KeyCode, Modifiers};
use crate::keyboard::{Key, Location, Modifiers};
use crate::SmolStr;

/// A keyboard event.
///
/// _**Note:** This type is largely incomplete! If you need to track
/// additional events, feel free to [open an issue] and share your use case!_
///
/// [open an issue]: https://github.com/iced-rs/iced/issues
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum Event {
/// A keyboard key was pressed.
KeyPressed {
/// The key identifier
key_code: KeyCode,
/// The key pressed.
key: Key,

/// The state of the modifier keys
/// The location of the key.
location: Location,

/// The state of the modifier keys.
modifiers: Modifiers,

/// The text produced by the key press, if any.
text: Option<SmolStr>,
},

/// A keyboard key was released.
KeyReleased {
/// The key identifier
key_code: KeyCode,
/// The key released.
key: Key,

/// The state of the modifier keys
/// The location of the key.
location: Location,

/// The state of the modifier keys.
modifiers: Modifiers,
},

/// A unicode character was received.
CharacterReceived(char),

/// The keyboard modifiers have changed.
ModifiersChanged(Modifiers),
}
Loading
Loading