From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: grischka Newsgroups: gmane.emacs.devel Subject: Re: Bikeshedding go! Why is unbound? Date: Tue, 18 Jan 2011 10:36:58 +0100 Message-ID: <4D355F3A.4040709@gmx.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1295343447 4387 80.91.229.12 (18 Jan 2011 09:37:27 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 18 Jan 2011 09:37:27 +0000 (UTC) Cc: emacs-devel@gnu.org To: ofv@wanadoo.es Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jan 18 10:37:23 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Pf807-0008Uj-9o for ged-emacs-devel@m.gmane.org; Tue, 18 Jan 2011 10:37:19 +0100 Original-Received: from localhost ([127.0.0.1]:60620 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pf806-00008I-If for ged-emacs-devel@m.gmane.org; Tue, 18 Jan 2011 04:37:18 -0500 Original-Received: from [140.186.70.92] (port=46032 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pf7zz-00008D-56 for emacs-devel@gnu.org; Tue, 18 Jan 2011 04:37:12 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Pf7zy-0003BL-5H for emacs-devel@gnu.org; Tue, 18 Jan 2011 04:37:10 -0500 Original-Received: from mailout-de.gmx.net ([213.165.64.22]:48286) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1Pf7zx-0003B7-P5 for emacs-devel@gnu.org; Tue, 18 Jan 2011 04:37:10 -0500 Original-Received: (qmail invoked by alias); 18 Jan 2011 09:37:06 -0000 Original-Received: from unknown (EHLO [10.74.202.98]) [82.113.106.198] by mail.gmx.net (mp038) with SMTP; 18 Jan 2011 10:37:06 +0100 X-Authenticated: #18588216 X-Provags-ID: V01U2FsdGVkX1/uRrccifnu8qKSQxEeZXHwhgFU5CcrVMx9psLbR3 Lu6CIGSMolj639 User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) Original-References: 87fwsrbnp7.fsf@wanadoo.es X-Y-GMX-Trusted: 0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) 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:134694 Archived-At: > This is unnecesary. The Windows event loop coded into Emacs already > receives Alt-F4 in a single event. What is needed is to determine from > that event loop if there is a binding for Alt-F4 (created with *-set-key > etc). Once we know that there is no such binding, it is trivial to send > back the Alt-F4 event back to Windows. Well, it would be difficult to determine on the Windows level whether the single keystroke was maybe part of C-x M-f4 or C-h M-f4. So in any case it is better to reuse emacs central event parser. To make some suggestion that could work: Store the key-code in a variable like this: case WM_SYSKEYDOWN: last_syskey_code = wParam; ... define keys emacs-wise like this: (global-set-key [M-f4] 'w32-syskey) with DEFUN w32_syskey() { PostMessage(frame_wnd, WM_EMACS_SYSKEY, last_syskey_code, 0); } and in wnd_proc() case WM_EMACS_SYSKEY: return DefWindowProc(hwnd, WM_SYSKEYDOWN, wParam, 0); All untested. Also note that for Alt- keys, WM_SYSCHAR needs to be handled as well. --- grischka