File tree 1 file changed +9
-1
lines changed
1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -1262,12 +1262,13 @@ impl Event {
1262
1262
1263
1263
EventType :: KeyDown => {
1264
1264
let event = raw. key ;
1265
+
1265
1266
Event :: KeyDown {
1266
1267
timestamp : event. timestamp ,
1267
1268
window_id : event. windowID ,
1268
1269
keycode : Keycode :: from_i32 ( event. keysym . sym as i32 ) ,
1269
1270
scancode : Scancode :: from_i32 ( event. keysym . scancode as i32 ) ,
1270
- keymod : keyboard:: Mod :: from_bits ( event. keysym . mod_ ) . unwrap ( ) ,
1271
+ keymod : Event :: unwrap_keymod ( keyboard:: Mod :: from_bits ( event. keysym . mod_ ) ) ,
1271
1272
repeat : event. repeat != 0
1272
1273
}
1273
1274
}
@@ -1607,6 +1608,13 @@ impl Event {
1607
1608
} } // close unsafe & match
1608
1609
}
1609
1610
1611
+ pub fn unwrap_keymod ( keymod_option : Option < keyboard:: Mod > ) -> keyboard:: Mod {
1612
+ match keymod_option {
1613
+ None => keyboard:: Mod :: empty ( ) ,
1614
+ Some ( x) => x,
1615
+ }
1616
+ }
1617
+
1610
1618
pub fn is_user_event ( & self ) -> bool {
1611
1619
match * self {
1612
1620
Event :: User { .. } => true ,
You can’t perform that action at this time.
0 commit comments