summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2014-08-22 18:44:33 +0200
committerBram Moolenaar <Bram@vim.org>2014-08-22 18:44:33 +0200
commitd2e8087b532e676cc513a2b385deaf1bf7afbf94 (patch)
tree8b2b7f6c436770aa3c5ee9238f18f0139afd2708
parentce2f2e061db91cc62e13023695dfa4a2755581f5 (diff)
updated for version 7.4.413v7.4.413
Problem: MS-Windows: Using US international keyboard layout, inserting dead key by pressing space does not always work. Issue 250. Solution: Let MS-Windows translate the message. (John Wellesz)
-rw-r--r--src/gui_w48.c31
-rw-r--r--src/version.c2
2 files changed, 17 insertions, 16 deletions
diff --git a/src/gui_w48.c b/src/gui_w48.c
index ae4c921c0d..cd7fdde549 100644
--- a/src/gui_w48.c
+++ b/src/gui_w48.c
@@ -614,6 +614,8 @@ _OnChar(
char_u string[40];
int len = 0;
+ dead_key = 0;
+
len = char_to_string(ch, string, 40, FALSE);
if (len == 1 && string[0] == Ctrl_C && ctrl_c_interrupts)
{
@@ -1788,24 +1790,21 @@ process_message(void)
if (msg.message == WM_KEYDOWN || msg.message == WM_SYSKEYDOWN)
{
vk = (int) msg.wParam;
- /* handle key after dead key, but ignore shift, alt and control */
- if (dead_key && vk != VK_SHIFT && vk != VK_MENU && vk != VK_CONTROL)
+ /*
+ * If a dead key was pressed and the user presses VK_SPACE, VK_BACK, or
+ * VK_ESCAPE it means that he actually wants to deal with the dead char
+ * now, so do nothing special and let Windows handle it.
+ *
+ * Note that VK_SPACE combines with the dead_key's character and only
+ * one WM_CHAR will be generated by TranslateMessage(), in the two
+ * other cases two WM_CHAR will be generated: the dead char and VK_BACK
+ * or VK_ESCAPE. That is most likely what the user expects.
+ */
+ if (dead_key && (vk == VK_SPACE || vk == VK_BACK || vk == VK_ESCAPE))
{
dead_key = 0;
- /* handle non-alphabetic keys (ones that hopefully cannot generate
- * umlaut-characters), unless when control is down */
- if (vk < 'A' || vk > 'Z' || (GetKeyState(VK_CONTROL) & 0x8000))
- {
- MSG dm;
-
- dm.message = msg.message;
- dm.hwnd = msg.hwnd;
- dm.wParam = VK_SPACE;
- MyTranslateMessage(&dm); /* generate dead character */
- if (vk != VK_SPACE) /* and send current character once more */
- PostMessage(msg.hwnd, msg.message, msg.wParam, msg.lParam);
- return;
- }
+ MyTranslateMessage(&msg);
+ return;
}
/* Check for CTRL-BREAK */
diff --git a/src/version.c b/src/version.c
index 40b7ae483a..e742d187c1 100644
--- a/src/version.c
+++ b/src/version.c
@@ -742,6 +742,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 413,
+/**/
412,
/**/
411,