// Normally, holding Cmd + any key never sends us a `keyUp` event for that key.
// Overriding `sendEvent:` like this fixes that. (https://stackoverflow.com/a/15294196)
// Fun fact: Firefox still has this bug! (https://bugzilla.mozilla.org/show_bug.cgi?id=1299553)
Normally, holding Cmd + any key never sends us a `keyUp` event for that key.
Overriding `sendEvent:` like this fixes that.
Fun fact: Firefox still has this bug!
Normally holding Cmd + any key never sends us a ` keyUp ` event for that key . Overriding ` sendEvent : ` like this fixes that . Fun fact : Firefox still has this bug!
extern "C" fn send_event(this: &Object, _sel: Sel, event: id) {
    unsafe {
        // For posterity, there are some undocumented event types
        // (https://github.com/servo/cocoa-rs/issues/155)
        // but that doesn't really matter here.
        let event_type = event.eventType();
        let modifier_flags = event.modifierFlags();
        if event_type == appkit::NSKeyUp
            && util::has_flag(
                modifier_flags,
                appkit::NSEventModifierFlags::NSCommandKeyMask,
            )
        {
            let key_window: id = msg_send![this, keyWindow];
            let _: () = msg_send![key_window, sendEvent: event];
        } else {
            maybe_dispatch_device_event(event);
            let superclass = util::superclass(this);
            let _: () = msg_send![super(this, superclass), sendEvent: event];
        }
    }
}
extern " " fn send_event ( this : & Object , _sel : Sel , event : id ) { unsafe { // For posterity, there are some undocumented event types // (https://github.com/servo/cocoa-rs/issues/155) // but that doesn't really matter here. let event_type = event . eventType ( ) ; let modifier_flags = event . modifierFlags ( ) ; if event_type == appkit :: NSKeyUp && util :: has_flag ( modifier_flags , appkit :: NSEventModifierFlags :: NSCommandKeyMask , ) { let key_window : id = msg_send ! [ this keyWindow ] ; let _ : ( ) = msg_send ! [ key_window sendEvent event ] ; } else { maybe_dispatch_device_event ( event ) ; let superclass = util :: superclass ( this ) ; let _ : ( ) = msg_send ! [ super ( this superclass ) sendEvent event ] ; } } }
Normally, holding Cmd + any key never sends us a `keyUp` event for that key.
Normally holding Cmd + any key never sends us a ` keyUp ` event for that key .
this
&Object
_sel
Sel
event
id