Describe the bug
The keyboard shortcut of zoom in (Ctrl+PlusEqual) does not work on the JIS keyboard layout.
On the JIS keyboard layout, we need the shift key to type + (Shift+;) or = (Shift+-).
https://en.wikipedia.org/wiki/Japanese_input_method
https://en.wikipedia.org/wiki/Keyboard_layout#Japanese
I have confirmed that this issue will be fixed with the following patch.
diff --git a/crates/egui/src/gui_zoom.rs b/crates/egui/src/gui_zoom.rs
index fb4f9bd..9cb8165 100644
--- a/crates/egui/src/gui_zoom.rs
+++ b/crates/egui/src/gui_zoom.rs
@@ -8,6 +8,8 @@ pub mod kb_shortcuts {
pub const ZOOM_IN: KeyboardShortcut =
KeyboardShortcut::new(Modifiers::COMMAND, Key::PlusEquals);
+ pub const ZOOM_IN_WITH_SHIFT: KeyboardShortcut =
+ KeyboardShortcut::new(Modifiers::COMMAND.plus(Modifiers::SHIFT), Key::PlusEquals);
pub const ZOOM_OUT: KeyboardShortcut = KeyboardShortcut::new(Modifiers::COMMAND, Key::Minus);
pub const ZOOM_RESET: KeyboardShortcut = KeyboardShortcut::new(Modifiers::COMMAND, Key::Num0);
}
@@ -21,7 +23,10 @@ pub(crate) fn zoom_with_keyboard(ctx: &Context) {
if ctx.input_mut(|i| i.consume_shortcut(&kb_shortcuts::ZOOM_RESET)) {
ctx.set_zoom_factor(1.0);
} else {
- if ctx.input_mut(|i| i.consume_shortcut(&kb_shortcuts::ZOOM_IN)) {
+ if ctx.input_mut(|i| {
+ i.consume_shortcut(&kb_shortcuts::ZOOM_IN)
+ || i.consume_shortcut(&kb_shortcuts::ZOOM_IN_WITH_SHIFT)
+ }) {
zoom_in(ctx);
}
if ctx.input_mut(|i| i.consume_shortcut(&kb_shortcuts::ZOOM_OUT)) {
Describe the bug
The keyboard shortcut of zoom in (
Ctrl+PlusEqual) does not work on the JIS keyboard layout.On the JIS keyboard layout, we need the shift key to type
+ (Shift+;)or= (Shift+-).https://en.wikipedia.org/wiki/Japanese_input_method
https://en.wikipedia.org/wiki/Keyboard_layout#Japanese
I have confirmed that this issue will be fixed with the following patch.