Skip to content

Commit f0474f2

Browse files
committed
Remove unused variable
1 parent a52f86d commit f0474f2

File tree

2 files changed

+2
-24
lines changed

2 files changed

+2
-24
lines changed

src/platform_impl/windows/event_loop.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@ mod runner;
55
use parking_lot::Mutex;
66
use std::{
77
cell::Cell,
8-
collections::{
9-
VecDeque,
10-
},
8+
collections::VecDeque,
119
marker::PhantomData,
1210
mem, panic, ptr,
1311
rc::Rc,

src/platform_impl/windows/keyboard.rs

+1-21
Original file line numberDiff line numberDiff line change
@@ -60,28 +60,10 @@ pub struct MessageAsKeyEvent {
6060
/// text input. The "sequence" only consists of one WM_KEYUP / WM_SYSKEYUP event.
6161
pub struct KeyEventBuilder {
6262
event_info: Option<PartialKeyEventInfo>,
63-
64-
/// The keyup event needs to call `ToUnicode` to determine what the text produced by the
65-
/// key with all modifiers except CTRL (the `logical_key`) is.
66-
///
67-
/// But `ToUnicode` without the non-modifying flag (see `key_labels`), resets the dead key
68-
/// state which would be incorrect during every keyup event. Therefore this variable is used
69-
/// to determine whether the last keydown event produced a dead key.
70-
///
71-
/// Note that this variable is not always correct because it does
72-
/// not track key presses outside of this window. However, the ONLY situation where this
73-
/// doesn't work as intended is when the user presses a dead key outside of this window, and
74-
/// switches to this window BEFORE releasing it then releases the dead key. In this case
75-
/// the `ToUnicode` function will be called, incorrectly clearing the dead key state. Having
76-
/// an inccorect behaviour only in this case seems acceptable.
77-
prev_down_was_dead: bool,
7863
}
7964
impl Default for KeyEventBuilder {
8065
fn default() -> Self {
81-
KeyEventBuilder {
82-
event_info: None,
83-
prev_down_was_dead: false,
84-
}
66+
KeyEventBuilder { event_info: None }
8567
}
8668
}
8769
impl KeyEventBuilder {
@@ -120,7 +102,6 @@ impl KeyEventBuilder {
120102
return vec![];
121103
}
122104
*result = ProcResult::Value(0);
123-
self.prev_down_was_dead = false;
124105

125106
let mut layouts = LAYOUT_CACHE.lock().unwrap();
126107
let event_info = PartialKeyEventInfo::from_message(
@@ -176,7 +157,6 @@ impl KeyEventBuilder {
176157
}
177158
winuser::WM_DEADCHAR | winuser::WM_SYSDEADCHAR => {
178159
*result = ProcResult::Value(0);
179-
self.prev_down_was_dead = true;
180160
// At this point, we know that there isn't going to be any more events related to
181161
// this key press
182162
let event_info = self.event_info.take().unwrap();

0 commit comments

Comments
 (0)