diff options
author | Gabor Kelemen <gabor.kelemen.extern@allotropia.de> | 2023-12-03 11:07:23 +0100 |
---|---|---|
committer | Thorsten Behrens <thorsten.behrens@allotropia.de> | 2023-12-06 15:51:42 +0100 |
commit | 9e8df5bfe804943a8662b52ff2afed936b79657d (patch) | |
tree | befcc382afc0f30ea3e663c002e13b262d7d65b3 /vcl | |
parent | 5de53775531a358c6775d265a3a19699c96a8139 (diff) |
tdf#148986 Support XF86Forward / XF86Back key events
Multimedia keys found on certain presentation clicker devices.
Not added to the Customize dialog, as that was not yet asked for.
As I have no access to a MAC, did not add support for that in vcl.
Inspiration for code taken from
commit ca74511985981444dbd72ade7244484c131e36a7
Change-Id: I417e6ba7e79c5f6e774a56ba747803a156d5f50f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160255
Tested-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/qt5/QtFrame.cxx | 6 | ||||
-rw-r--r-- | vcl/qt5/QtWidget.cxx | 6 | ||||
-rw-r--r-- | vcl/unx/generic/app/saldisp.cxx | 12 | ||||
-rw-r--r-- | vcl/unx/gtk3/gtkframe.cxx | 4 | ||||
-rw-r--r-- | vcl/win/window/salframe.cxx | 32 |
5 files changed, 58 insertions, 2 deletions
diff --git a/vcl/qt5/QtFrame.cxx b/vcl/qt5/QtFrame.cxx index cde1a06b3dd8..24dcb5ff6f61 100644 --- a/vcl/qt5/QtFrame.cxx +++ b/vcl/qt5/QtFrame.cxx @@ -952,6 +952,12 @@ OUString QtFrame::GetKeyName(sal_uInt16 nKeyCode) case KEY_NUMBERSIGN: nRetCode = Qt::Key_NumberSign; break; + case KEY_XF86FORWARD: + nRetCode = Qt::Key_Forward; + break; + case KEY_XF86BACK: + nRetCode = Qt::Key_Back; + break; case KEY_COLON: nRetCode = Qt::Key_Colon; break; diff --git a/vcl/qt5/QtWidget.cxx b/vcl/qt5/QtWidget.cxx index aae1f52c4ec8..a7c4f32e9243 100644 --- a/vcl/qt5/QtWidget.cxx +++ b/vcl/qt5/QtWidget.cxx @@ -449,6 +449,12 @@ static sal_uInt16 GetKeyCode(int keyval, Qt::KeyboardModifiers modifiers) case Qt::Key_NumberSign: nCode = KEY_NUMBERSIGN; break; + case Qt::Key_Forward: + nCode = KEY_XF86FORWARD; + break; + case Qt::Key_Back: + nCode = KEY_XF86BACK; + 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 37a04f20d6ef..6733e483239a 100644 --- a/vcl/unx/generic/app/saldisp.cxx +++ b/vcl/unx/generic/app/saldisp.cxx @@ -908,6 +908,12 @@ OUString SalDisplay::GetKeyName( sal_uInt16 nKeyCode ) const case KEY_NUMBERSIGN: aCustomKeyName = "#"; break; + case KEY_XF86FORWARD: + aCustomKeyName = "XF86Forward"; + break; + case KEY_XF86BACK: + aCustomKeyName = "XF86Back"; + break; case KEY_COLON: aCustomKeyName = ":"; break; @@ -1269,6 +1275,12 @@ sal_uInt16 SalDisplay::GetKeyCode( KeySym keysym, char*pcPrintable ) const nKey = KEY_COLON; *pcPrintable = ':'; break; + case 0x1008ff27: // tdf#148986: XF86Forward + nKey = KEY_XF86FORWARD; + break; + case 0x1008ff26: // tdf#148986: XF86Back + nKey = KEY_XF86BACK; + break; // - - - - - - - - - - - - - Apollo - - - - - - - - - - - - - 0x1000 case 0x1000FF02: // apXK_Copy nKey = KEY_COPY; diff --git a/vcl/unx/gtk3/gtkframe.cxx b/vcl/unx/gtk3/gtkframe.cxx index f063f80b7dea..f996b4359b1d 100644 --- a/vcl/unx/gtk3/gtkframe.cxx +++ b/vcl/unx/gtk3/gtkframe.cxx @@ -223,6 +223,8 @@ sal_uInt16 GtkSalFrame::GetKeyCode(guint keyval) 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_Forward: nCode = KEY_XF86FORWARD; break; + case GDK_KEY_Back: nCode = KEY_XF86BACK; break; case GDK_KEY_colon: nCode = KEY_COLON; break; // some special cases, also see saldisp.cxx // - - - - - - - - - - - - - Apollo - - - - - - - - - - - - - 0x1000 @@ -2882,6 +2884,8 @@ void GtkSalFrame::KeyCodeToGdkKey(const vcl::KeyCode& rKeyCode, 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_XF86FORWARD: nKeyCode = GDK_KEY_Forward; break; + case KEY_XF86BACK: nKeyCode = GDK_KEY_Back; break; case KEY_COLON: nKeyCode = GDK_KEY_colon; break; // Special cases diff --git a/vcl/win/window/salframe.cxx b/vcl/win/window/salframe.cxx index aaafe56ee887..019ebaf229dd 100644 --- a/vcl/win/window/salframe.cxx +++ b/vcl/win/window/salframe.cxx @@ -541,7 +541,7 @@ HWND ImplSalReCreateHWND( HWND hWndParent, HWND oldhWnd, bool bAsChild ) } // translation table from System keycodes into StartView keycodes -#define KEY_TAB_SIZE 146 +#define KEY_TAB_SIZE 168 const sal_uInt16 aImplTranslateKeyTab[KEY_TAB_SIZE] = { @@ -691,7 +691,29 @@ const sal_uInt16 aImplTranslateKeyTab[KEY_TAB_SIZE] = 0, // 142 0, // 143 0, // NUMLOCK 144 - 0 // SCROLLLOCK 145 + 0, // SCROLLLOCK 145 + 0, // 146 + 0, // 147 + 0, // 148 + 0, // 149 + 0, // 150 + 0, // 151 + 0, // 152 + 0, // 153 + 0, // 154 + 0, // 155 + 0, // 156 + 0, // 157 + 0, // 158 + 0, // 159 + 0, // 160 + 0, // 161 + 0, // 162 + 0, // 163 + 0, // 164 + 0, // 165 + KEY_XF86BACK, // VK_BROWSER_BACK 166 + KEY_XF86FORWARD // VK_BROWSER_FORWARD 167 }; static UINT ImplSalGetWheelScrollLines() @@ -2510,6 +2532,12 @@ OUString WinSalFrame::GetKeyName( sal_uInt16 nKeyCode ) case KEY_NUMBERSIGN: cSVCode = '#'; break; + case KEY_XF86FORWARD: + cSVCode = VK_BROWSER_FORWARD; + break; + case KEY_XF86BACK: + cSVCode = VK_BROWSER_BACK; + break; case KEY_COLON: cSVCode = ':'; break; |