@@ -447,7 +447,7 @@ extern fn key_down(this: &Object, _sel: Sel, event: id) {
447447 Some ( string. to_owned ( ) )
448448 } ;
449449
450- state. pending_events . access ( |pending| {
450+ let pass_along = state. pending_events . access ( |pending| {
451451 pending. queue_event ( window_event) ;
452452 // Emit `ReceivedCharacter` for key repeats
453453 if is_repeat && state. is_key_down {
@@ -458,14 +458,19 @@ extern fn key_down(this: &Object, _sel: Sel, event: id) {
458458 } ;
459459 pending. queue_event ( window_event) ;
460460 }
461+ false
461462 } else {
462- // Some keys (and only *some*, with no known reason) don't trigger `insertText`, while others do...
463- // So, we don't give repeats the opportunity to trigger that, since otherwise our hack will cause some
464- // keys to generate twice as many characters.
465- let array: id = msg_send ! [ class!( NSArray ) , arrayWithObject: event] ;
466- let _: ( ) = msg_send ! [ this, interpretKeyEvents: array] ;
463+ true
467464 }
468465 } ) ;
466+
467+ if let Some ( true ) = pass_along {
468+ // Some keys (and only *some*, with no known reason) don't trigger `insertText`, while others do...
469+ // So, we don't give repeats the opportunity to trigger that, since otherwise our hack will cause some
470+ // keys to generate twice as many characters.
471+ let array: id = msg_send ! [ class!( NSArray ) , arrayWithObject: event] ;
472+ let _: ( ) = msg_send ! [ this, interpretKeyEvents: array] ;
473+ }
469474 }
470475}
471476
0 commit comments