emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bikeshedding go! Why is <M-f4> unbound?


From: grischka
Subject: Re: Bikeshedding go! Why is <M-f4> unbound?
Date: Tue, 18 Jan 2011 10:36:58 +0100
User-agent: Thunderbird 2.0.0.23 (Windows/20090812)

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-<letter> keys, WM_SYSCHAR needs
to be handled as well.

--- grischka




reply via email to

[Prev in Thread] Current Thread [Next in Thread]