summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeoff Voelker <voelker@cs.washington.edu>1996-02-02 02:01:53 +0000
committerGeoff Voelker <voelker@cs.washington.edu>1996-02-02 02:01:53 +0000
commit9113797ecf51601302cacb3adc99d96dfca94175 (patch)
tree34acb4118c447c00c569264741e3c984e4a5c4a2
parent5d0683e2f6215816aa96ce1a0e3f44e2e5384ae0 (diff)
downloademacs-9113797ecf51601302cacb3adc99d96dfca94175.tar.gz
(win32_kbd_mods_to_emacs, win32_kbd_patch_key,
key_event): Convert from static to global functions. (win32_kbd_patch_key): Set modifiers when AltGr is pressed. (key_event): Don't modify code on window input.
-rw-r--r--src/w32inevt.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/w32inevt.c b/src/w32inevt.c
index beeaae630b6..80e8cdf21c4 100644
--- a/src/w32inevt.c
+++ b/src/w32inevt.c
@@ -92,7 +92,7 @@ get_frame (void)
/* Translate console modifiers to emacs modifiers.
German keyboard support (Kai Morgan Zeise 2/18/95). */
-static int
+int
win32_kbd_mods_to_emacs (DWORD mods)
{
int retval = 0;
@@ -121,7 +121,7 @@ win32_kbd_mods_to_emacs (DWORD mods)
}
/* The return code indicates key code size. */
-static int
+int
win32_kbd_patch_key (KEY_EVENT_RECORD *event)
{
unsigned int key_code = event->wVirtualKeyCode;
@@ -138,11 +138,20 @@ win32_kbd_patch_key (KEY_EVENT_RECORD *event)
}
if (event->uChar.AsciiChar != 0)
return 1;
+
memset (keystate, 0, sizeof (keystate));
if (mods & SHIFT_PRESSED)
keystate[VK_SHIFT] = 0x80;
if (mods & CAPSLOCK_ON)
keystate[VK_CAPITAL] = 1;
+ if ((mods & LEFT_CTRL_PRESSED) && (mods & RIGHT_ALT_PRESSED))
+ {
+ keystate[VK_CONTROL] = 0x80;
+ keystate[VK_LCONTROL] = 0x80;
+ keystate[VK_MENU] = 0x80;
+ keystate[VK_RMENU] = 0x80;
+ }
+
isdead = ToAscii (event->wVirtualKeyCode, event->wVirtualScanCode,
keystate, (LPWORD) ansi_code, 0);
if (isdead == 0)
@@ -275,7 +284,7 @@ static int map_virt_key[256] =
/* return code -1 means that event_queue_ptr won't be incremented.
In other word, this event makes two key codes. (by himi) */
-static int
+int
key_event (KEY_EVENT_RECORD *event, struct input_event *emacs_ev)
{
int map;
@@ -349,7 +358,9 @@ key_event (KEY_EVENT_RECORD *event, struct input_event *emacs_ev)
* make_lispy_event () now requires non-ascii codes to have
* the full X keysym values (2nd byte is 0xff). add it on.
*/
+#ifndef HAVE_NTGUI
map |= 0xff00;
+#endif
XSETINT (emacs_ev->code, map);
}
/* for Mule 2.2 (Based on Emacs 19.28) */