diff options
author | Ward van Wanrooij <ward@ward.nu> | 2017-11-27 19:44:26 +0100 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2018-01-19 12:58:28 +0100 |
commit | 52d9378a683c4e33e0a3dd7c6fc6f2c0dfc60125 (patch) | |
tree | 25811f76ab731ad11c94643dd6854ec4b6b376d7 /vcl | |
parent | b3fc12b713163428c111e62948c3e40ce931db5a (diff) |
vcl osx: fix decimal separator key when localized
If you use OS X and an international locale (e.g. Locale setting:
Dutch (Netherlands) and select Decimal separator key: Same as
locale setting (,) in Preferences/Language Settings/Languages using
the decimal separator key on the numeric keypad still results in a
'.' instead of the expected ','. Tested and confirmed using latest
LO build on 10.11.6 and 10.12.6 using both the wired and wireless
Apple keyboard.
The cause for this is that the decimal separator key sends a
KEY_POINT (like the regular . key on the alphanumeric part) and
the code expects a KEY_DECIMAL for the decimal separator key.
Fixed by changing the combination of KEY_POINT and mask
NSNumericPadKeyMask to KEY_DECIMAL.
Change-Id: Iaf1ecf538c3e1a49ad512851cf16dd4dd991cb06
Reviewed-on: https://gerrit.libreoffice.org/45362
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/osx/salframeview.mm | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/vcl/osx/salframeview.mm b/vcl/osx/salframeview.mm index c79244a0011e..e33ccb188616 100644 --- a/vcl/osx/salframeview.mm +++ b/vcl/osx/salframeview.mm @@ -156,6 +156,8 @@ static const struct ExceptionalKey { const sal_uInt16 nKeyCode; const unsigned int nModifierMask; + const sal_uInt16 nModifiedKeyCode; + const bool bZeroCharacter; } aExceptionalKeys[] = { SAL_WNODEPRECATED_DECLARATIONS_PUSH @@ -163,8 +165,10 @@ SAL_WNODEPRECATED_DECLARATIONS_PUSH // 'NSCommandKeyMask' is deprecated: first deprecated in macOS 10.12 // 'NSControlKeyMask' is deprecated: first deprecated in macOS 10.12 // 'NSShiftKeyMask' is deprecated: first deprecated in macOS 10.12 - { KEY_D, NSControlKeyMask | NSShiftKeyMask | NSAlternateKeyMask }, - { KEY_D, NSCommandKeyMask | NSShiftKeyMask | NSAlternateKeyMask } + // 'NSNumericPadKeyMask' is deprecated: first deprecated in macOS 10.12 + { KEY_D, NSControlKeyMask | NSShiftKeyMask | NSAlternateKeyMask, KEY_D, true }, + { KEY_D, NSCommandKeyMask | NSShiftKeyMask | NSAlternateKeyMask, KEY_D, true }, + { KEY_POINT, NSNumericPadKeyMask, KEY_DECIMAL, false } SAL_WNODEPRECATED_DECLARATIONS_POP }; @@ -1018,7 +1022,7 @@ SAL_WNODEPRECATED_DECLARATIONS_POP (mpFrame->mnLastModifierFlags & aExceptionalKeys[i].nModifierMask) == aExceptionalKeys[i].nModifierMask ) { - [self sendKeyInputAndReleaseToFrame: nKeyCode character: 0]; + [self sendKeyInputAndReleaseToFrame: aExceptionalKeys[i].nModifiedKeyCode character: (aExceptionalKeys[i].bZeroCharacter ? 0 : keyChar) ]; return YES; } |