editor2-issues icon indicating copy to clipboard operation
editor2-issues copied to clipboard

Increase font size does not work with keyboard shortcut

Open amel opened this issue 7 years ago • 5 comments

Expected behaviour

The font size gets increased.

Actual behaviour

Keyboard shortcut does not work as it should.

Steps to reproduce

I tried to increase the font size with the keys ⌘ and + but that did not work. ⌘ and - did work and decreased the font size. To increase the font size I now need to use the menu > view > increase font size item.


Build time2018-08-28T09:07:35.632147
Defold channeleditor-alpha
Defold editor sha8bba2570d5e2984cd49b6bad0da863db6efb0545
Defold engine sha1b90c9a905d634b766b467e3536458b9210ec812
Defold version1.2.135
GPUIntel(R) Iris(TM) Graphics 6100
GPU Driver2.1 INTEL-10.36.19
Java version1.8.0_102-b14
OS archx86_64
OS nameMac OS X
OS version10.13.6

amel avatar Aug 29 '18 08:08 amel

Hi @amel! Works on my machine :) What keyboard layout are you using?

erikangelin-king avatar Aug 30 '18 07:08 erikangelin-king

Hi @erikangelin-king! Strange. I'm using the US international keyboard layout.

amel avatar Aug 30 '18 09:08 amel

Thanks! Alright, we're mostly testing with a swedish keyboard layout but we know we need to look into others at some point. Strange though that US doesn't work.

erikangelin-king avatar Aug 30 '18 10:08 erikangelin-king

#1236

erikangelin-king avatar Aug 30 '18 10:08 erikangelin-king

Let me start by saying that these comments only apply to the Mac version. The way JavaFX works on Windows is substantially different so it's not likely that whatever I say here will apply to #2190.

Work-around: whenever Defold has the focus press Shift+'=' to generate a + character. The shortcut will start working. You can even do this at the splash screen.

The central problem is that JavaFX on the Mac can't figure out where a shifted character is until the user types it. Holding down Cmd and pressing the key with + on it is not enough, since you're not holding down Shift internally the system sees an = character go by so it still has no idea where + is.

A source code fix would be to add ["Meta+'='" :zoom-in] as a binding in addition to ["Meta+'+'" :zoom-in]. Keyboard layouts on the Mac generally come in two flavors, those where = and + are on the same key and those where = is Shift+0 and + is somewhere else. For the latter keyboards (such as German) the double binding means Meta+0 would invoke zoom-in in addition to Meta+'+'. (Though keep in mind that the same JavaFX limitation applies, on a keyboard where = requires a Shift the system won't be able to figure out where it is until the user types it).

beldenfox avatar Mar 03 '21 22:03 beldenfox