mirror of
https://github.com/rust-windowing/winit.git
synced 2026-08-31 22:00:04 -04:00
macOS: Fix doubled key repeats (#570)
This commit is contained in:
committed by
GitHub
parent
38bc6babb7
commit
289fb47a34
@@ -396,11 +396,14 @@ extern fn key_down(this: &Object, _sel: Sel, event: id) {
|
||||
.unwrap()
|
||||
.push_back(window_event);
|
||||
}
|
||||
} else {
|
||||
// Some keys (and only *some*, with no known reason) don't trigger `insertText`, while others do...
|
||||
// So, we don't give repeats the opportunity to trigger that, since otherwise our hack will cause some
|
||||
// keys to generate twice as many characters.
|
||||
let array: id = msg_send![class("NSArray"), arrayWithObject:event];
|
||||
let (): _ = msg_send![this, interpretKeyEvents:array];
|
||||
}
|
||||
}
|
||||
|
||||
let array: id = msg_send![class("NSArray"), arrayWithObject:event];
|
||||
let (): _ = msg_send![this, interpretKeyEvents:array];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user