emacs-devel
[Top][All Lists]
Advanced

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

Re: Key bindings proposal


From: Lennart Borgman
Subject: Re: Key bindings proposal
Date: Fri, 6 Aug 2010 04:55:48 +0200

On Fri, Aug 6, 2010 at 4:34 AM, Lennart Borgman
<address@hidden> wrote:
> On Fri, Aug 6, 2010 at 3:58 AM, Lennart Borgman
> <address@hidden> wrote:
>> On Fri, Aug 6, 2010 at 3:41 AM, Lennart Borgman
>> <address@hidden> wrote:
>>> On Fri, Aug 6, 2010 at 3:35 AM, Jason Rumney <address@hidden> wrote:
>>
>>>> http://stackoverflow.com/questions/2490577/suppress-task-switch-keys-winkey-alt-tab-alt-esc-ctrl-esc-using-low-level-ke
>>>
>>>
>>> Thanks. I will test the last one and see. That is a recent article.
>>
>> This article code uses HasAltModifier to test for Alt in the low level
>> keyboard hook. It seems to be some c++ variant. What can I do instead
>> in Emacs?
>
> I tested with code similar to this:
>
>            case VK_TAB:
>              /*
>                Tip from Jason 2010-08-05 regarding suppressing
> Alt-TAB in the hook:
>
> http://stackoverflow.com/questions/2490577/suppress-task-switch-keys-winkey-alt-tab-alt-esc-ctrl-esc-using-low-level-ke
>
>                For the computer user instead, using registry setting of
>                [HKEY_CURRENT_USER\Control Panel\Desktop]
>                "CoolSwitch"="0"
>
> http://stackoverflow.com/questions/2970683/disable-windows-and-alt-tab-key-combos
>              */
>
>              {
>                //if (HasAltModifier(pkbdllhook->flags))
>                if ((pkbdllhook->flags & LLKHF_ALTDOWN) != 0)
>                  {
>                    // return new IntPtr(1);
>                    return TRUE;

Removing "return TRUE" and instead doing

                    bHandle = NILP(Vw32_pass_alt_to_system);
                    break;

made this work as Jason suggested. I.e. it allows the use of Alt-TAB
as M-TAB on w32. (The back draw is that you then can not switch to
other applications using Alt-TAB when in Emacs.)

Other application will still respond the normal way to Alt-TAB.

I must say again I am surprised that this worked. I wonder though is
this is documented behavior. If it is, then maybe it is time to
include the low level keyboard hook in Emacs? (I myself does not like
this behavior, but others might want it.)


>                  }
>              }
>
> It surprised me in several ways:
>
> - It actually suppressed Alt-TAB, but for ALL RUNNING PROGRAMS! (That
> make me think of that Eli once said that the low level keyboard hook
> would affect all programs. It normally does not so there is something
> strange here.)
>
> So the code above can not be used in Emacs. Does someone has any idea
> of what is wrong here?
>



reply via email to

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