@@ -60,28 +60,10 @@ pub struct MessageAsKeyEvent {
60
60
/// text input. The "sequence" only consists of one WM_KEYUP / WM_SYSKEYUP event.
61
61
pub struct KeyEventBuilder {
62
62
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 ,
78
63
}
79
64
impl Default for KeyEventBuilder {
80
65
fn default ( ) -> Self {
81
- KeyEventBuilder {
82
- event_info : None ,
83
- prev_down_was_dead : false ,
84
- }
66
+ KeyEventBuilder { event_info : None }
85
67
}
86
68
}
87
69
impl KeyEventBuilder {
@@ -120,7 +102,6 @@ impl KeyEventBuilder {
120
102
return vec ! [ ] ;
121
103
}
122
104
* result = ProcResult :: Value ( 0 ) ;
123
- self . prev_down_was_dead = false ;
124
105
125
106
let mut layouts = LAYOUT_CACHE . lock ( ) . unwrap ( ) ;
126
107
let event_info = PartialKeyEventInfo :: from_message (
@@ -176,7 +157,6 @@ impl KeyEventBuilder {
176
157
}
177
158
winuser:: WM_DEADCHAR | winuser:: WM_SYSDEADCHAR => {
178
159
* result = ProcResult :: Value ( 0 ) ;
179
- self . prev_down_was_dead = true ;
180
160
// At this point, we know that there isn't going to be any more events related to
181
161
// this key press
182
162
let event_info = self . event_info . take ( ) . unwrap ( ) ;
0 commit comments