From bfe3a47e1e5bb51b7f9440b6155d002eedcea22b Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Tue, 17 Feb 2015 10:33:47 +0100 Subject: 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 --- desktop/source/lib/init.cxx | 6 +++--- desktop/source/lib/lokandroid.cxx | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'desktop') diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 3be8a2002eaa..a144b51969bf 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -265,7 +265,7 @@ static char * lo_getError (LibreOfficeKit* pThis); static LibreOfficeKitDocument* lo_documentLoadWithOptions (LibreOfficeKit* pThis, const char* pURL, const char* pOptions); -static void lo_postKeyEvent (LibreOfficeKit* pThis, int nType, int nCode); +static void lo_postKeyEvent (LibreOfficeKit* pThis, int nType, int nCharCode, int nKeyCode); struct LibLibreOffice_Impl : public _LibreOfficeKit @@ -712,12 +712,12 @@ static char* lo_getError (LibreOfficeKit *pThis) return pMemory; } -static void lo_postKeyEvent(LibreOfficeKit* /*pThis*/, int nType, int nCode) +static void lo_postKeyEvent(LibreOfficeKit* /*pThis*/, int nType, int nCharCode, int nKeyCode) { #if defined(UNX) && !defined(MACOSX) && !defined(ENABLE_HEADLESS) if (SalFrame *pFocus = SvpSalFrame::GetFocusFrame()) { - KeyEvent aEvent(nCode, nCode, 0); + KeyEvent aEvent(nCharCode, nKeyCode, 0); switch (nType) { case LOK_KEYEVENT_KEYINPUT: diff --git a/desktop/source/lib/lokandroid.cxx b/desktop/source/lib/lokandroid.cxx index 5403ea0544ad..9ea1842975a3 100644 --- a/desktop/source/lib/lokandroid.cxx +++ b/desktop/source/lib/lokandroid.cxx @@ -76,10 +76,10 @@ extern "C" SAL_JNI_EXPORT void JNICALL Java_org_libreoffice_kit_Office_destroyAn } extern "C" SAL_JNI_EXPORT void JNICALL Java_org_libreoffice_kit_Office_postKeyEvent - (JNIEnv* pEnv, jobject aObject, jint nType, jint nCode) + (JNIEnv* pEnv, jobject aObject, jint nType, jint nCharCode, jint nKeyCode) { LibreOfficeKit* pLibreOfficeKit = getHandle(pEnv, aObject); - pLibreOfficeKit->pClass->postKeyEvent(pLibreOfficeKit, nType, nCode); + pLibreOfficeKit->pClass->postKeyEvent(pLibreOfficeKit, nType, nCharCode, nKeyCode); } namespace -- cgit v1.2.3