scenebuilder icon indicating copy to clipboard operation
scenebuilder copied to clipboard

fix: Zoom-in/out using keyboard shortcut not working correctly

Open Oliver-Loeffler opened this issue 1 year ago • 7 comments

Zoom-In/Out was supposed to work with keyboard shortcuts. For Zoom-In MODIFIER++ and for Zoom-Out MODIFIER+/ were defined. The predefined KeyCombinations were not working, there seems something wrong with how KeyCodes are handled especially on macOS but also on Windows. This might become an issue for OpenJFX which is a separate thing.

I've played a while with suitable settings which work on Win/Mac/Linux and settled with following idea:

Platform(s) Accelerator Action Preview App (with GER keyb. layout)
WIndows, Linux CTRL++ Zoom In ok
WIndows, Linux CTRL+- Zoom Out ok
WIndows, Linux CTRL++ (on num key pad) Zoom In ok
WIndows, Linux CTRL+- (on num key pad) Zoom Out ok
macOS 12.0.1 CMD++ Zoom In ok
macOS 12.0.1 CMD+- Zoom Out ok
macOS 12.0.1 CMD++ (on num key pad) Zoom In ok
macOS 12.0.1 CMD+- (on num key pad) Zoom Out ok
Platform(s) Accelerator Action Preview App (any keyb. layout with cursors)
WIndows, Linux SHIFT+CTRL+up Zoom In ok
WIndows, Linux SHIFT+CTRL+right Zoom In ok
WIndows, Linux SHIFT+CTRL+left Zoom Out ok
WIndows, Linux SHIFT+CTRL+down Zoom Out ok
macOS 12.0.1 SHIFT+CMD+up Zoom In ok
macOS 12.0.1 SHIFT+CMD+right Zoom In ok
macOS 12.0.1 SHIFT+CMD+left Zoom Out ok
macOS 12.0.1 SHIFT+CMD+down Zoom Out ok

The DocumentWindowController offers a mainKeyEventFilter where those double accelerators can be tracked. All key handling happens in MenuBarController but this is called from mainKeyEventFilter in DocumentWindowController.

ZoomControls_PlusMinus

ZoomControls_Arrows

Issue

Fixes #424

Progress

Oliver-Loeffler avatar Oct 19 '22 18:10 Oliver-Loeffler