@@ -143,44 +143,44 @@ pub unsafe fn convert(
143143 let key = key_from_code ( code) ;
144144
145145 // Determine if this is a press or release based on flag changes
146- let global_flags = LAST_FLAGS . lock ( ) . unwrap ( ) ;
146+ let mut global_flags = LAST_FLAGS . lock ( ) . unwrap ( ) ;
147147 if flags. contains ( CGEventFlags :: CGEventFlagShift )
148148 && !global_flags. contains ( CGEventFlags :: CGEventFlagShift )
149149 {
150150 * global_flags = flags;
151151 Some ( EventType :: KeyPress ( key) )
152152 } else if !flags. contains ( CGEventFlags :: CGEventFlagShift )
153- && * global_flags. contains ( CGEventFlags :: CGEventFlagShift )
153+ && global_flags. contains ( CGEventFlags :: CGEventFlagShift )
154154 {
155155 * global_flags = flags;
156156 Some ( EventType :: KeyRelease ( key) )
157157 } else if flags. contains ( CGEventFlags :: CGEventFlagControl )
158- && !* global_flags. contains ( CGEventFlags :: CGEventFlagControl )
158+ && !global_flags. contains ( CGEventFlags :: CGEventFlagControl )
159159 {
160160 * global_flags = flags;
161161 Some ( EventType :: KeyPress ( key) )
162162 } else if !flags. contains ( CGEventFlags :: CGEventFlagControl )
163- && * global_flags. contains ( CGEventFlags :: CGEventFlagControl )
163+ && global_flags. contains ( CGEventFlags :: CGEventFlagControl )
164164 {
165165 * global_flags = flags;
166166 Some ( EventType :: KeyRelease ( key) )
167167 } else if flags. contains ( CGEventFlags :: CGEventFlagAlternate )
168- && !* global_flags. contains ( CGEventFlags :: CGEventFlagAlternate )
168+ && !global_flags. contains ( CGEventFlags :: CGEventFlagAlternate )
169169 {
170170 * global_flags = flags;
171171 Some ( EventType :: KeyPress ( key) )
172172 } else if !flags. contains ( CGEventFlags :: CGEventFlagAlternate )
173- && * global_flags. contains ( CGEventFlags :: CGEventFlagAlternate )
173+ && global_flags. contains ( CGEventFlags :: CGEventFlagAlternate )
174174 {
175175 * global_flags = flags;
176176 Some ( EventType :: KeyRelease ( key) )
177177 } else if flags. contains ( CGEventFlags :: CGEventFlagCommand )
178- && !* global_flags. contains ( CGEventFlags :: CGEventFlagCommand )
178+ && !global_flags. contains ( CGEventFlags :: CGEventFlagCommand )
179179 {
180180 * global_flags = flags;
181181 Some ( EventType :: KeyPress ( key) )
182182 } else if !flags. contains ( CGEventFlags :: CGEventFlagCommand )
183- && * global_flags. contains ( CGEventFlags :: CGEventFlagCommand )
183+ && global_flags. contains ( CGEventFlags :: CGEventFlagCommand )
184184 {
185185 * global_flags = flags;
186186 Some ( EventType :: KeyRelease ( key) )
0 commit comments