summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorGökay Şatır <gokaysatir@collabora.com>2023-10-04 15:01:38 +0300
committerCaolán McNamara <caolan.mcnamara@collabora.com>2023-10-14 21:51:43 +0200
commitca74511985981444dbd72ade7244484c131e36a7 (patch)
tree18650e2ccf975fa0825f2c42e3c24b523c5ae012 /vcl
parent025372363e5310ffe0e729648f97faef2fe784eb (diff)
Add NUMBERSIGN key handler.
German keyboard layout has number sign key. Users can print number sign without using modification keys. So this key can be assigned a shortcut. Subscript is assigned to CTRL + NUMBERSIGN. Below PR is used as reference when adding the new key handler: https://gerrit.libreoffice.org/c/core/+/86713 Signed-off-by: Gökay Şatır <gokaysatir@collabora.com> Change-Id: I340dc47764e9200d2477f8db740a629f62f48004 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157554 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> (cherry picked from commit 1db8f6d484b884301a7d3673f4d05478e28cd853) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157959 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/osx/salframe.cxx1
-rw-r--r--vcl/osx/salmenu.cxx3
-rw-r--r--vcl/qt5/QtFrame.cxx3
-rw-r--r--vcl/qt5/QtWidget.cxx3
-rw-r--r--vcl/unx/generic/app/saldisp.cxx7
-rw-r--r--vcl/unx/gtk3/gtkframe.cxx2
-rw-r--r--vcl/win/app/salinst.cxx1
-rw-r--r--vcl/win/window/salframe.cxx3
8 files changed, 23 insertions, 0 deletions
diff --git a/vcl/osx/salframe.cxx b/vcl/osx/salframe.cxx
index 9ecb6cfd2423..98c165d9659f 100644
--- a/vcl/osx/salframe.cxx
+++ b/vcl/osx/salframe.cxx
@@ -1096,6 +1096,7 @@ OUString AquaSalFrame::GetKeyName( sal_uInt16 nKeyCode )
aKeyMap[ KEY_SEMICOLON ] = ";";
aKeyMap[ KEY_QUOTERIGHT ] = "'";
aKeyMap[ KEY_RIGHTCURLYBRACKET ] = "}";
+ aKeyMap[ KEY_NUMBERSIGN ] = "#";
aKeyMap[ KEY_COLON ] = ":";
/* yet unmapped KEYCODES:
diff --git a/vcl/osx/salmenu.cxx b/vcl/osx/salmenu.cxx
index bc2c5bed7cce..b3d02587f46b 100644
--- a/vcl/osx/salmenu.cxx
+++ b/vcl/osx/salmenu.cxx
@@ -655,6 +655,9 @@ void AquaSalMenu::SetAccelerator( unsigned /*nPos*/, SalMenuItem* pSalMenuItem,
case KEY_COLON:
nCommandKey=':';
break;
+ case KEY_NUMBERSIGN:
+ nCommandKey='#';
+ break;
case KEY_SEMICOLON:
nCommandKey=';';
break;
diff --git a/vcl/qt5/QtFrame.cxx b/vcl/qt5/QtFrame.cxx
index 49d542a64909..f3cc0facfe8a 100644
--- a/vcl/qt5/QtFrame.cxx
+++ b/vcl/qt5/QtFrame.cxx
@@ -992,6 +992,9 @@ OUString QtFrame::GetKeyName(sal_uInt16 nKeyCode)
case KEY_BRACKETRIGHT:
nRetCode = Qt::Key_BracketRight;
break;
+ case KEY_NUMBERSIGN:
+ nRetCode = Qt::Key_NumberSign;
+ break;
case KEY_COLON:
nRetCode = Qt::Key_Colon;
break;
diff --git a/vcl/qt5/QtWidget.cxx b/vcl/qt5/QtWidget.cxx
index 5e7d1d56c464..48c0d22c58fd 100644
--- a/vcl/qt5/QtWidget.cxx
+++ b/vcl/qt5/QtWidget.cxx
@@ -450,6 +450,9 @@ static sal_uInt16 GetKeyCode(int keyval, Qt::KeyboardModifiers modifiers)
case Qt::Key_BracketRight:
nCode = KEY_BRACKETRIGHT;
break;
+ case Qt::Key_NumberSign:
+ nCode = KEY_NUMBERSIGN;
+ break;
case Qt::Key_Colon:
nCode = KEY_COLON;
break;
diff --git a/vcl/unx/generic/app/saldisp.cxx b/vcl/unx/generic/app/saldisp.cxx
index 774b34bfbd0a..37a04f20d6ef 100644
--- a/vcl/unx/generic/app/saldisp.cxx
+++ b/vcl/unx/generic/app/saldisp.cxx
@@ -905,6 +905,9 @@ OUString SalDisplay::GetKeyName( sal_uInt16 nKeyCode ) const
case KEY_RIGHTCURLYBRACKET:
aCustomKeyName = "}";
break;
+ case KEY_NUMBERSIGN:
+ aCustomKeyName = "#";
+ break;
case KEY_COLON:
aCustomKeyName = ":";
break;
@@ -1258,6 +1261,10 @@ sal_uInt16 SalDisplay::GetKeyCode( KeySym keysym, char*pcPrintable ) const
nKey = KEY_RIGHTCURLYBRACKET;
*pcPrintable = '\'';
break;
+ case XK_numbersign:
+ nKey = KEY_NUMBERSIGN;
+ *pcPrintable = '#';
+ break;
case XK_colon:
nKey = KEY_COLON;
*pcPrintable = ':';
diff --git a/vcl/unx/gtk3/gtkframe.cxx b/vcl/unx/gtk3/gtkframe.cxx
index ca83d17bb180..b1bf8474b1b2 100644
--- a/vcl/unx/gtk3/gtkframe.cxx
+++ b/vcl/unx/gtk3/gtkframe.cxx
@@ -222,6 +222,7 @@ sal_uInt16 GtkSalFrame::GetKeyCode(guint keyval)
case GDK_KEY_semicolon: nCode = KEY_SEMICOLON; break;
case GDK_KEY_quoteright: nCode = KEY_QUOTERIGHT; break;
case GDK_KEY_braceright: nCode = KEY_RIGHTCURLYBRACKET; break;
+ case GDK_KEY_numbersign: nCode = KEY_NUMBERSIGN; break;
case GDK_KEY_colon: nCode = KEY_COLON; break;
// some special cases, also see saldisp.cxx
// - - - - - - - - - - - - - Apollo - - - - - - - - - - - - - 0x1000
@@ -2880,6 +2881,7 @@ void GtkSalFrame::KeyCodeToGdkKey(const vcl::KeyCode& rKeyCode,
case KEY_SEMICOLON: nKeyCode = GDK_KEY_semicolon; break;
case KEY_QUOTERIGHT: nKeyCode = GDK_KEY_quoteright; break;
case KEY_RIGHTCURLYBRACKET: nKeyCode = GDK_KEY_braceright; break;
+ case KEY_NUMBERSIGN: nKeyCode = GDK_KEY_numbersign; break;
case KEY_COLON: nKeyCode = GDK_KEY_colon; break;
// Special cases
diff --git a/vcl/win/app/salinst.cxx b/vcl/win/app/salinst.cxx
index a2aabbab2870..eb4adb853e10 100644
--- a/vcl/win/app/salinst.cxx
+++ b/vcl/win/app/salinst.cxx
@@ -235,6 +235,7 @@ void SalData::initKeyCodeMap()
initKey( L';', KEY_SEMICOLON );
initKey( L'\'', KEY_QUOTERIGHT );
initKey( L'}', KEY_RIGHTCURLYBRACKET );
+ initKey( L'#', KEY_NUMBERSIGN);
initKey( L':', KEY_COLON );
}
diff --git a/vcl/win/window/salframe.cxx b/vcl/win/window/salframe.cxx
index 7c26ea1e903f..3228caf2f345 100644
--- a/vcl/win/window/salframe.cxx
+++ b/vcl/win/window/salframe.cxx
@@ -2512,6 +2512,9 @@ OUString WinSalFrame::GetKeyName( sal_uInt16 nKeyCode )
case KEY_EQUAL:
cSVCode = '=';
break;
+ case KEY_NUMBERSIGN:
+ cSVCode = '#';
+ break;
case KEY_COLON:
cSVCode = ':';
break;