Rename ime_key -> key_char and update behavior (#20953)
As part of the recent changes to keyboard support, ime_key is no longer populated by the IME; but instead by the keyboard. As part of #20877 I changed some code to assume that falling back to key was ok, but this was not ok; instead we need to populate this more similarly to how it was done before #20336. The alternative fix could be to instead of simulating these events in our own code to push a fake native event back to the platform input handler. Closes #ISSUE Release Notes: - Fixed a bug where tapping `shift` coudl type "shift" if you had a binding on "shift shift"
This commit is contained in:
parent
37a59d6b2e
commit
e062f30d9e
14 changed files with 77 additions and 79 deletions
|
@ -3038,7 +3038,7 @@ impl<'a> WindowContext<'a> {
|
|||
return true;
|
||||
}
|
||||
|
||||
if let Some(input) = keystroke.with_simulated_ime().ime_key {
|
||||
if let Some(input) = keystroke.key_char {
|
||||
if let Some(mut input_handler) = self.window.platform_window.take_input_handler() {
|
||||
input_handler.dispatch_input(&input, self);
|
||||
self.window.platform_window.set_input_handler(input_handler);
|
||||
|
@ -3267,7 +3267,7 @@ impl<'a> WindowContext<'a> {
|
|||
if let Some(key) = key {
|
||||
keystroke = Some(Keystroke {
|
||||
key: key.to_string(),
|
||||
ime_key: None,
|
||||
key_char: None,
|
||||
modifiers: Modifiers::default(),
|
||||
});
|
||||
}
|
||||
|
@ -3482,13 +3482,7 @@ impl<'a> WindowContext<'a> {
|
|||
if !self.propagate_event {
|
||||
continue 'replay;
|
||||
}
|
||||
if let Some(input) = replay
|
||||
.keystroke
|
||||
.with_simulated_ime()
|
||||
.ime_key
|
||||
.as_ref()
|
||||
.cloned()
|
||||
{
|
||||
if let Some(input) = replay.keystroke.key_char.as_ref().cloned() {
|
||||
if let Some(mut input_handler) = self.window.platform_window.take_input_handler() {
|
||||
input_handler.dispatch_input(&input, self);
|
||||
self.window.platform_window.set_input_handler(input_handler)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue