From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jason Rumney Newsgroups: gmane.emacs.devel Subject: Re: w32-pass-lwindow-to-system does not work as expected Date: Wed, 06 Jul 2005 08:08:58 +0100 Message-ID: References: <42CADC1A.4060106@student.lu.se> <42CB0D00.3030900@student.lu.se> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1120635109 16806 80.91.229.2 (6 Jul 2005 07:31:49 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 6 Jul 2005 07:31:49 +0000 (UTC) Cc: Eli Zaretskii , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jul 06 09:31:40 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Dq4NX-00028g-JH for ged-emacs-devel@m.gmane.org; Wed, 06 Jul 2005 09:31:31 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Dq4Op-0008VM-Vi for ged-emacs-devel@m.gmane.org; Wed, 06 Jul 2005 03:32:52 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Dq4MU-0007hC-Vu for emacs-devel@gnu.org; Wed, 06 Jul 2005 03:30:28 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Dq4MD-0007dj-Ty for emacs-devel@gnu.org; Wed, 06 Jul 2005 03:30:24 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Dq4M9-0007YI-RB for emacs-devel@gnu.org; Wed, 06 Jul 2005 03:30:07 -0400 Original-Received: from [194.106.33.237] (helo=outmail.freedom2surf.net) by monty-python.gnu.org with esmtp (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA:24) (Exim 4.34) id 1Dq4Gk-0002Eo-W0; Wed, 06 Jul 2005 03:24:31 -0400 Original-Received: from wanchan.jasonrumney.net (i-83-67-23-108.freedom2surf.net [83.67.23.108]) by outmail.freedom2surf.net (8.12.10/8.12.10) with ESMTP id j667I6ch006535; Wed, 6 Jul 2005 08:18:06 +0100 Original-Received: from TONKOTSU-RAMEN (tonkotsu-ramen.jasonrumney.net [10.0.0.28]) by wanchan.jasonrumney.net (Postfix) with ESMTP id D8248DDDF8; Wed, 6 Jul 2005 08:18:31 +0100 (BST) Original-To: Lennart Borgman In-Reply-To: <42CB0D00.3030900@student.lu.se> (Lennart Borgman's message of "Wed, 06 Jul 2005 00:43:12 +0200") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (windows-nt) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:40494 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:40494 Lennart Borgman writes: > *** Removing the low level keyboard hook at the main thread tear down: > UnhookWindowsHookEx(hLowKBhook); You also need to remove the hook whenever Emacs crashes. That is more difficult, and the reason why I would be reluctant to start playing with Low Level hooks within Emacs. > case VK_LWIN: > { > // the user pressed the key > if (!NILP (Vw32_pass_lwindow_to_system)) > fHandled = TRUE; > break; > } > } > } > } > > return (fHandled ? TRUE : CallNextHookEx(hhook, nCode, wParam, lParam)); If my reading of the docs is correct, this will prevent Emacs from seeing lwindow keys altogether. If you return true from a low level keyboard hook, you must handle the key inside the hook. Since you want to use lwindow as a modifier key, you'll then need to handle all the keys that it modifies in the hook as well, and you'll end up doing all your own keyboard mapping, as Eli said.