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 | |
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>
-rw-r--r-- | include/vcl/keycodes.hxx | 2 | ||||
-rw-r--r-- | offapi/com/sun/star/awt/Key.idl | 6 | ||||
-rw-r--r-- | sd/source/console/PresenterController.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/slideshow/slideshowimpl.cxx | 2 | ||||
-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 |
9 files changed, 70 insertions, 2 deletions
diff --git a/include/vcl/keycodes.hxx b/include/vcl/keycodes.hxx index 2efe29a55fbb..8eb1a0ec8c2c 100644 --- a/include/vcl/keycodes.hxx +++ b/include/vcl/keycodes.hxx @@ -156,6 +156,8 @@ constexpr sal_uInt16 KEY_SEMICOLON = css::awt::Key::SEMICOLON; constexpr sal_uInt16 KEY_QUOTERIGHT = css::awt::Key::QUOTERIGHT; constexpr sal_uInt16 KEY_RIGHTCURLYBRACKET = css::awt::Key::RIGHTCURLYBRACKET; constexpr sal_uInt16 KEY_NUMBERSIGN = css::awt::Key::NUMBERSIGN; +constexpr sal_uInt16 KEY_XF86FORWARD = css::awt::Key::XF86FORWARD; +constexpr sal_uInt16 KEY_XF86BACK = css::awt::Key::XF86BACK; constexpr sal_uInt16 KEY_COLON = css::awt::Key::COLON; constexpr sal_uInt16 KEY_CAPSLOCK = css::awt::Key::CAPSLOCK; diff --git a/offapi/com/sun/star/awt/Key.idl b/offapi/com/sun/star/awt/Key.idl index d9f45257ce8c..b07ff78dab54 100644 --- a/offapi/com/sun/star/awt/Key.idl +++ b/offapi/com/sun/star/awt/Key.idl @@ -375,6 +375,12 @@ published constants Key /* # sign. @since LibreOffice 24.2 */ const short NUMBERSIGN = 191; + /* XF86Forward @since LibreOffice 24.2 */ + const short XF86FORWARD = 167; + + /* XF86Back @since LibreOffice 24.2 */ + const short XF86BACK = 166; + /** The following values don't correspond to physical keys on any keyboard but are used in the macOS implementation of VCL. They correspond to some of the action messages of the NSResponder diff --git a/sd/source/console/PresenterController.cxx b/sd/source/console/PresenterController.cxx index 2a0e6d25aa47..7bb137d8c03b 100644 --- a/sd/source/console/PresenterController.cxx +++ b/sd/source/console/PresenterController.cxx @@ -845,6 +845,7 @@ void SAL_CALL PresenterController::keyReleased (const awt::KeyEvent& rEvent) case awt::Key::RIGHT: case awt::Key::SPACE: case awt::Key::DOWN: + case awt::Key::XF86FORWARD: if (mxSlideShowController.is()) { mxSlideShowController->gotoNextEffect(); @@ -864,6 +865,7 @@ void SAL_CALL PresenterController::keyReleased (const awt::KeyEvent& rEvent) case awt::Key::LEFT: case awt::Key::UP: case awt::Key::BACKSPACE: + case awt::Key::XF86BACK: if (mxSlideShowController.is()) { mxSlideShowController->gotoPreviousEffect(); diff --git a/sd/source/ui/slideshow/slideshowimpl.cxx b/sd/source/ui/slideshow/slideshowimpl.cxx index 7619624544b4..1e739ab97f26 100644 --- a/sd/source/ui/slideshow/slideshowimpl.cxx +++ b/sd/source/ui/slideshow/slideshowimpl.cxx @@ -1848,6 +1848,7 @@ bool SlideshowImpl::keyInput(const KeyEvent& rKEvt) case KEY_SPACE: case KEY_RIGHT: case KEY_DOWN: + case KEY_XF86FORWARD: gotoNextEffect(); break; @@ -1893,6 +1894,7 @@ bool SlideshowImpl::keyInput(const KeyEvent& rKEvt) case KEY_LEFT: case KEY_UP: case KEY_BACKSPACE: + case KEY_XF86BACK: gotoPreviousEffect(); break; 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; |