Always mark keydown events as handled to suppress beep
This commit is contained in:
parent
3d6c257551
commit
3c5d7e001e
1 changed files with 2 additions and 5 deletions
|
@ -721,19 +721,16 @@ extern "C" fn handle_key_equivalent(this: &Object, _: Sel, native_event: id) ->
|
|||
let _: BOOL = msg_send![input_context, handleEvent: native_event];
|
||||
}
|
||||
|
||||
let mut handled = false;
|
||||
let mut window_state_borrow = window_state.borrow_mut();
|
||||
if let Some(event) = window_state_borrow.pending_key_down_event.take() {
|
||||
if let Some(mut callback) = window_state_borrow.event_callback.take() {
|
||||
drop(window_state_borrow);
|
||||
handled = callback(Event::KeyDown(event));
|
||||
callback(Event::KeyDown(event));
|
||||
window_state.borrow_mut().event_callback = Some(callback);
|
||||
}
|
||||
} else {
|
||||
handled = true;
|
||||
}
|
||||
|
||||
handled as BOOL
|
||||
YES
|
||||
} else {
|
||||
NO
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue