summaryrefslogtreecommitdiff
path: root/src/w32term.h
diff options
context:
space:
mode:
authorJussi Lahdenniemi <jussi@aprikoodi.fi>2016-02-26 12:51:24 +0200
committerEli Zaretskii <eliz@gnu.org>2016-02-26 12:51:24 +0200
commit97d7a0b8db4ce32a8e489dec48634b7e85212eaa (patch)
treee1477561851991fe7be1213747d201d744794286 /src/w32term.h
parent22994735af588be9c2d6d438155b73328aaa0cf3 (diff)
downloademacs-97d7a0b8db4ce32a8e489dec48634b7e85212eaa.tar.gz
Improve the register-hotkey functionality on MS-Windows
* src/w32fns.c (_WIN32_WINNT): Define to 0x0600, needed for keyboard hook functionality. Include w32inevt.h, basetyps.h and unknwn.h. (VK_ANY, WM_WTSSESSION_CHANGE, WTS_SESSION_LOCK): New macros. (kbdhook): A new struct definition. (funhook, setup_w32_kbdhook, remove_w32_kbdhook, hook_w32_key) (check_w32_winkey_state, reset_w32_kbdhook_state): New functions. (modifier_set): Call check_w32_winkey_state if a Win key was pressed and the keyboard hook is active. (w32_wnd_proc): Don't handle Win key combinations if the keyboard hook is active. Only register/unregister the hotkeys if the keyboard hook is not active. When WM_CREATE is received, call setup_w32_kbdhook. When WM_DESTROY is received, call reset_w32_kbdhook_state. (lookup_vk_code): When the keyboard hook is active, map alphanumeric characters to themselves. (w32_parse_and_hook_hot_key): Renamed from w32_parse_hot_key. Map modified keys to VK_ANY if the keyboard hook is active. Register Alt-x and Win-x combinations. (Fw32_shell_execute): Update doc string to reflect new functionality. Bypass the code that posts the WM_EMACS_REGISTER_HOT_KEY message if the keyboard hook is active. (Fw32_unregister_hot_key): Bypass the code that posts the WM_EMACS_UNREGISTER_HOT_KEY message if the keyboard hook is active. (syms_of_w32fns) <w32-pass-lwindow-to-system> <w32-pass-rwindow-to-system, w32-phantom-key-code> <w32-lwindow-modifier, w32-rwindow-modifier>: Update doc strings to reflect the new functionality. * src/w32console.c (initialize_w32_display): Install the low-level keyboard hook. * src/w32inevt.c (key_event): Handle Win-x combinations only if the keyboard hook is not active. If the hook is active, use check_w32_winkey_state instead. * src/w32term.h (setup_w32_kbdhook, remove_w32_kbdhook) (check_w32_winkey_state): Add prototypes. (w32_kbdhook_active): New macro. * doc/emacs/msdos.texi (Windows Keyboard): Update to reflect the new functionality.
Diffstat (limited to 'src/w32term.h')
-rw-r--r--src/w32term.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/w32term.h b/src/w32term.h
index 50906241f98..aed89d8c254 100644
--- a/src/w32term.h
+++ b/src/w32term.h
@@ -738,6 +738,12 @@ extern int handle_file_notifications (struct input_event *);
extern void w32_initialize_display_info (Lisp_Object);
extern void initialize_w32_display (struct terminal *, int *, int *);
+/* Keyboard hooks. */
+extern void setup_w32_kbdhook (void);
+extern void remove_w32_kbdhook (void);
+extern int check_w32_winkey_state (int);
+#define w32_kbdhook_active (os_subtype != OS_9X)
+
/* Keypad command key support. W32 doesn't have virtual keys defined
for the function keys on the keypad (they are mapped to the standard
function keys), so we define our own. */