Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPierre-Yves B.2019-06-21 20:47:01 +0000
committerNiraj Modi2019-08-13 07:21:10 +0000
commite68a42b079cb4a66deb813e36d6b80529014c633 (patch)
tree5f82ae50c9a45ac2064e159437c12831a3b4c102 /bundles
parent838be573171c77ff91e96093ffe2294b2a0b3d53 (diff)
downloadeclipse.platform.swt-e68a42b079cb4a66deb813e36d6b80529014c633.tar.gz
eclipse.platform.swt-e68a42b079cb4a66deb813e36d6b80529014c633.tar.xz
eclipse.platform.swt-e68a42b079cb4a66deb813e36d6b80529014c633.zip
Bug 219750 - [styled text] Typing ~~ inserts é~~
If last WM_KEYDOWN corresponded to a dead key, ignore the subsequent VM_KEYDOWN message and let the events be sent by WM_CHAR only. Change-Id: I8d916d9fb00f090e0f569ede37e4e520856cc48a Signed-off-by: Pierre-Yves B. <PyvesDev@gmail.com>
Diffstat (limited to 'bundles')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Widget.java15
1 files changed, 14 insertions, 1 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Widget.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Widget.java
index 78992e7284..ad1f538449 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Widget.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Widget.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2017 IBM Corporation and others.
+ * Copyright (c) 2000, 2019 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -10,6 +10,7 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
+ * Pierre-Yves B., pyvesdev@gmail.com - Bug 219750: [styled text] Typing ~~ inserts é~~
*******************************************************************************/
package org.eclipse.swt.widgets;
@@ -1557,6 +1558,7 @@ LRESULT wmKeyDown (long hwnd, long wParam, long lParam) {
if ((lParam & 0x40000000) != 0) return null;
}
+ boolean lastDead = display.lastDead;
/* Clear last key and last ascii because a new key has been typed */
display.lastAscii = display.lastKey = 0;
display.lastVirtual = display.lastNull = display.lastDead = false;
@@ -1605,6 +1607,17 @@ LRESULT wmKeyDown (long hwnd, long wParam, long lParam) {
}
/*
+ * When hitting accent keys twice in a row, PeekMessage only returns
+ * a WM_DEADCHAR for the first WM_KEYDOWN. Ignore the second
+ * WM_KEYDOWN and issue the key down event from inside WM_CHAR.
+ */
+ if (lastDead) {
+ display.lastVirtual = mapKey == 0;
+ display.lastKey = display.lastVirtual ? (int)wParam : mapKey;
+ return null;
+ }
+
+ /*
* Bug in Windows. Somehow, the widget is becoming disposed after
* calling PeekMessage(). In rare circumstances, it seems that
* PeekMessage() can allow SWT listeners to run that might contain

Back to the top