Deadkeys 2 (#20612)
Re-land of #20515 with less brokenness In particular it turns out that for control, the .characters() method returns the control code. This mostly didn't make a difference, except when the control code matched tab/enter/escape (for ctrl-y,ctrl-[/ctrl-c) as we interpreted the key incorrectly. Secondly, we were setting IME key too aggressively. This led to (in vim mode) cmd-shift-{ being interpreted as [, so vim would wait for a second [ before letting you change tab. Release Notes: - N/A
This commit is contained in:
parent
ad31aacb7a
commit
96deabfb78
8 changed files with 252 additions and 224 deletions
|
@ -688,6 +688,11 @@ impl PlatformInputHandler {
|
|||
.flatten()
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
fn apple_press_and_hold_enabled(&mut self) -> bool {
|
||||
self.handler.apple_press_and_hold_enabled()
|
||||
}
|
||||
|
||||
pub(crate) fn dispatch_input(&mut self, input: &str, cx: &mut WindowContext) {
|
||||
self.handler.replace_text_in_range(None, input, cx);
|
||||
}
|
||||
|
@ -785,6 +790,15 @@ pub trait InputHandler: 'static {
|
|||
range_utf16: Range<usize>,
|
||||
cx: &mut WindowContext,
|
||||
) -> Option<Bounds<Pixels>>;
|
||||
|
||||
/// Allows a given input context to opt into getting raw key repeats instead of
|
||||
/// sending these to the platform.
|
||||
/// TODO: Ideally we should be able to set ApplePressAndHoldEnabled in NSUserDefaults
|
||||
/// (which is how iTerm does it) but it doesn't seem to work for me.
|
||||
#[allow(dead_code)]
|
||||
fn apple_press_and_hold_enabled(&mut self) -> bool {
|
||||
true
|
||||
}
|
||||
}
|
||||
|
||||
/// The variables that can be configured when creating a new window
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue