From 2666b3aecf0b9919e64c52f5b096383503584cf1 Mon Sep 17 00:00:00 2001 From: Bruce Mitchener Date: Sat, 3 May 2025 18:19:33 +0700 Subject: [PATCH] Fix typos from updated `typos` tool --- README.md | 2 +- src/keyboard.rs | 2 +- src/platform/web.rs | 2 +- src/platform_impl/linux/common/xkb/mod.rs | 2 +- src/platform_impl/linux/wayland/seat/pointer/mod.rs | 2 +- src/platform_impl/linux/x11/util/mod.rs | 2 +- src/platform_impl/windows/keyboard.rs | 7 +++---- src/platform_impl/windows/raw_input.rs | 6 +++--- 8 files changed, 12 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 8386d7c635..ebcebba209 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ Winit is designed to be a low-level brick in a hierarchy of libraries. Consequen show something on the window you need to use the platform-specific getters provided by winit, or another library. -## CONTRIBUING +## CONTRIBUTING For contributing guidelines see [CONTRIBUTING.md](./CONTRIBUTING.md). diff --git a/src/keyboard.rs b/src/keyboard.rs index 9b9127dd16..f1838d9ff9 100644 --- a/src/keyboard.rs +++ b/src/keyboard.rs @@ -1224,7 +1224,7 @@ pub enum NamedKey { Dimmer, /// Swap video sources. (`VK_DISPLAY_SWAP`) DisplaySwap, - /// Select Digital Video Rrecorder. (`KEYCODE_DVR`) + /// Select Digital Video Recorder. (`KEYCODE_DVR`) DVR, /// Exit the current application. (`VK_EXIT`) Exit, diff --git a/src/platform/web.rs b/src/platform/web.rs index 7fc181f109..db7387306a 100644 --- a/src/platform/web.rs +++ b/src/platform/web.rs @@ -656,7 +656,7 @@ pub enum Orientation { Portrait, } -/// Screen orientation lock options. Reoresents which orientations a user can use. +/// Screen orientation lock options. Represents which orientations a user can use. #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] pub enum OrientationLock { /// User is free to use any orientation. diff --git a/src/platform_impl/linux/common/xkb/mod.rs b/src/platform_impl/linux/common/xkb/mod.rs index b96d7f3c14..ad6cf484d1 100644 --- a/src/platform_impl/linux/common/xkb/mod.rs +++ b/src/platform_impl/linux/common/xkb/mod.rs @@ -325,7 +325,7 @@ impl<'a, 'b> KeyEventResults<'a, 'b> { // The current behaviour makes it so composing a character overrides attempts to input a // control character with the `Ctrl` key. We can potentially add a configuration option - // if someone specifically wants the oppsite behaviour. + // if someone specifically wants the opposite behaviour. pub fn text_with_all_modifiers(&mut self) -> Option { match self.composed_text() { Ok(text) => text, diff --git a/src/platform_impl/linux/wayland/seat/pointer/mod.rs b/src/platform_impl/linux/wayland/seat/pointer/mod.rs index 94fcd861c4..a7c6c6d7da 100644 --- a/src/platform_impl/linux/wayland/seat/pointer/mod.rs +++ b/src/platform_impl/linux/wayland/seat/pointer/mod.rs @@ -215,7 +215,7 @@ impl PointerHandler for WinitState { pointer_data.phase = phase; // Mice events have both pixel and discrete delta's at the same time. So prefer - // the descrite values if they are present. + // the discrete values if they are present. let delta = if has_discrete_scroll { // NOTE: Wayland sign convention is the inverse of winit. MouseScrollDelta::LineDelta( diff --git a/src/platform_impl/linux/x11/util/mod.rs b/src/platform_impl/linux/x11/util/mod.rs index 47768b76c3..9f034aff4d 100644 --- a/src/platform_impl/linux/x11/util/mod.rs +++ b/src/platform_impl/linux/x11/util/mod.rs @@ -51,7 +51,7 @@ where } impl XConnection { - // This is impoartant, so pay attention! + // This is important, so pay attention! // Xlib has an output buffer, and tries to hide the async nature of X from you. // This buffer contains the requests you make, and is flushed under various circumstances: // 1. `XPending`, `XNextEvent`, and `XWindowEvent` flush "as needed" diff --git a/src/platform_impl/windows/keyboard.rs b/src/platform_impl/windows/keyboard.rs index 1f85088c87..f426d4b1d5 100644 --- a/src/platform_impl/windows/keyboard.rs +++ b/src/platform_impl/windows/keyboard.rs @@ -211,8 +211,7 @@ impl KeyEventBuilder { .unwrap_or(false); if more_char_coming { // No need to produce an event just yet, because there are still more - // characters that need to appended to this keyobard - // event + // characters that need to be appended to this keyboard event MatchResult::TokenToRemove(pending_token) } else { let mut event_info = self.event_info.lock().unwrap(); @@ -333,8 +332,8 @@ impl KeyEventBuilder { // 1. If caps-lock is *not* held down but *is* active, then we have to synthesize all // printable keys, respecting the caps-lock state. // 2. If caps-lock is held down, we could choose to synthesize its keypress after every - // other key, in which case all other keys *must* be sythesized as if the caps-lock state - // was be the opposite of what it currently is. + // other key, in which case all other keys *must* be synthesized as if the caps-lock + // state was be the opposite of what it currently is. // -- // For the sake of simplicity we are choosing to always synthesize // caps-lock first, and always use the current caps-lock state diff --git a/src/platform_impl/windows/raw_input.rs b/src/platform_impl/windows/raw_input.rs index a64394e3cd..90b4dd12c8 100644 --- a/src/platform_impl/windows/raw_input.rs +++ b/src/platform_impl/windows/raw_input.rs @@ -225,16 +225,16 @@ pub fn get_keyboard_physical_key(keyboard: RAWKEYBOARD) -> Option { if scancode == 0xe11d || scancode == 0xe02a { // At the hardware (or driver?) level, pressing the Pause key is equivalent to pressing // Ctrl+NumLock. - // This equvalence means that if the user presses Pause, the keyboard will emit two + // This equivalence means that if the user presses Pause, the keyboard will emit two // subsequent keypresses: // 1, 0xE11D - Which is a left Ctrl (0x1D) with an extension flag (0xE100) // 2, 0x0045 - Which on its own can be interpreted as Pause // // There's another combination which isn't quite an equivalence: - // PrtSc used to be Shift+Asterisk. This means that on some keyboards, presssing + // PrtSc used to be Shift+Asterisk. This means that on some keyboards, pressing // PrtSc (print screen) produces the following sequence: // 1, 0xE02A - Which is a left shift (0x2A) with an extension flag (0xE000) - // 2, 0xE037 - Which is a numpad multiply (0x37) with an exteion flag (0xE000). This on + // 2, 0xE037 - Which is a numpad multiply (0x37) with an extension flag (0xE000). This on // its own it can be interpreted as PrtSc // // For this reason, if we encounter the first keypress, we simply ignore it, trusting