diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-02-17 10:33:47 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-02-23 10:10:22 +0100 |
commit | bfe3a47e1e5bb51b7f9440b6155d002eedcea22b (patch) | |
tree | 4abe069df6959ac50b108063d56173482c1f878d /libreofficekit | |
parent | 0622d2658a8ccadadfb5eb2180a252833c3a9c22 (diff) |
lok::Office::postKeyEvent: allow different char and key code
editeng is not happy with non-zero char code for css::awt::Key::ESCAPE.
Change-Id: If26923df7defb8a47766e9109835a8569067e578
Diffstat (limited to 'libreofficekit')
-rw-r--r-- | libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx index c2fc02bb21ab..fbaa97fa224d 100644 --- a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx +++ b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx @@ -135,7 +135,8 @@ void changeQuadView( GtkWidget* /*pButton*/, gpointer /* pItem */ ) static void signalKey(GtkWidget* /*pWidget*/, GdkEventKey* pEvent, gpointer /*pData*/) { LOKDocView* pLOKDocView = LOK_DOCVIEW(pDocView); - int nCode = 0; + int nCharCode = 0; + int nKeyCode = 0; if (!pLOKDocView->m_bEdit) { @@ -146,25 +147,25 @@ static void signalKey(GtkWidget* /*pWidget*/, GdkEventKey* pEvent, gpointer /*pD switch (pEvent->keyval) { case GDK_BackSpace: - nCode = com::sun::star::awt::Key::BACKSPACE; + nKeyCode = com::sun::star::awt::Key::BACKSPACE; break; case GDK_Return: - nCode = com::sun::star::awt::Key::RETURN; + nKeyCode = com::sun::star::awt::Key::RETURN; break; case GDK_Escape: - nCode = com::sun::star::awt::Key::ESCAPE; + nKeyCode = com::sun::star::awt::Key::ESCAPE; break; default: if (pEvent->keyval >= GDK_F1 && pEvent->keyval <= GDK_F26) - nCode = com::sun::star::awt::Key::F1 + (pEvent->keyval - GDK_F1); + nKeyCode = com::sun::star::awt::Key::F1 + (pEvent->keyval - GDK_F1); else - nCode = gdk_keyval_to_unicode(pEvent->keyval); + nCharCode = gdk_keyval_to_unicode(pEvent->keyval); } if (pEvent->type == GDK_KEY_RELEASE) - pLOKDocView->pOffice->pClass->postKeyEvent(pLOKDocView->pOffice, LOK_KEYEVENT_KEYUP, nCode); + pLOKDocView->pOffice->pClass->postKeyEvent(pLOKDocView->pOffice, LOK_KEYEVENT_KEYUP, nCharCode, nKeyCode); else - pLOKDocView->pOffice->pClass->postKeyEvent(pLOKDocView->pOffice, LOK_KEYEVENT_KEYINPUT, nCode); + pLOKDocView->pOffice->pClass->postKeyEvent(pLOKDocView->pOffice, LOK_KEYEVENT_KEYINPUT, nCharCode, nKeyCode); } // GtkComboBox requires gtk 2.24 or later |