From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lennart Borgman Newsgroups: gmane.emacs.devel Subject: Re: Key bindings proposal Date: Fri, 6 Aug 2010 04:55:48 +0200 Message-ID: References: <19534.1494.627000.357123@gargle.gargle.HOWL> <19537.40472.267000.563053@gargle.gargle.HOWL> <176EDAD3B9E54E39870FA3F84A5DDF3C@us.oracle.com> <19542.56658.583000.394397@gargle.gargle.HOWL> <19544.1015.468000.280770@gargle.gargle.HOWL> <19546.30901.687000.971249@gargle.gargle.HOWL> <19546.47167.15000.439215@gargle.gargle.HOWL> <4C5B5C39.9090104@gnu.org> <4C5B66DD.2060901@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1281063422 16635 80.91.229.12 (6 Aug 2010 02:57:02 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 6 Aug 2010 02:57:02 +0000 (UTC) Cc: emacs-devel@gnu.org To: Jason Rumney Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Aug 06 04:56:59 2010 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 1OhD7D-0002vW-5b for ged-emacs-devel@m.gmane.org; Fri, 06 Aug 2010 04:56:59 +0200 Original-Received: from localhost ([127.0.0.1]:60705 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OhD7C-0005iS-Ge for ged-emacs-devel@m.gmane.org; Thu, 05 Aug 2010 22:56:58 -0400 Original-Received: from [140.186.70.92] (port=55284 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OhD6o-0005bm-EG for emacs-devel@gnu.org; Thu, 05 Aug 2010 22:56:35 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OhD6n-0007Ty-8h for emacs-devel@gnu.org; Thu, 05 Aug 2010 22:56:34 -0400 Original-Received: from mail-qw0-f41.google.com ([209.85.216.41]:36635) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OhD6n-0007Ts-3l; Thu, 05 Aug 2010 22:56:33 -0400 Original-Received: by qwk4 with SMTP id 4so5290166qwk.0 for ; Thu, 05 Aug 2010 19:56:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:in-reply-to :references:from:date:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=gWcalMtNtmC+Jbmg6pEUSXyyDOIYhjZlZp75GLtxKTY=; b=f7O6M24h+0lFcUDvd/7hCFU+hlgIOazw694dF25ZtguwgqWOfeAXLQgsraDHTgIT/3 bPeVPP5aENC/GPu8BGt8B1WOvRAPSR/pwIs4US81wmkk0I20I4zLHziKWqD24RymKhTE T9firL5qFXZewL8pbsnmtcGP0rZBzrp+RjfP8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=m905ofKgIfYXY+Fx3QOGI5Mw4DAtZ4jFu/dy7ptNHpIbYMDBTZ958HGiwv2a3I8F6w kfBz3zbSG4ceqkLyRnH78d8fZCoSxpc4K9poxGPJWObsxVYGo2o+JpMmVbisq0Uf3yES SqksHxvj6l6e2Fy8uuV2KMh8fs+aeu+ihP/N4= Original-Received: by 10.229.1.203 with SMTP id 11mr4073766qcg.238.1281063368190; Thu, 05 Aug 2010 19:56:08 -0700 (PDT) Original-Received: by 10.229.9.84 with HTTP; Thu, 5 Aug 2010 19:55:48 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) 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:128344 Archived-At: On Fri, Aug 6, 2010 at 4:34 AM, Lennart Borgman wrote: > On Fri, Aug 6, 2010 at 3:58 AM, Lennart Borgman > wrote: >> On Fri, Aug 6, 2010 at 3:41 AM, Lennart Borgman >> wrote: >>> On Fri, Aug 6, 2010 at 3:35 AM, Jason Rumney wrote: >> >>>> http://stackoverflow.com/questions/2490577/suppress-task-switch-keys-w= inkey-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: > > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0case VK_TAB: > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0/* > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Tip from Jason 201= 0-08-05 regarding suppressing > Alt-TAB in the hook: > > http://stackoverflow.com/questions/2490577/suppress-task-switch-keys-wink= ey-alt-tab-alt-esc-ctrl-esc-using-low-level-ke > > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0For the computer u= ser instead, using registry setting of > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0[HKEY_CURRENT_USER= \Control Panel\Desktop] > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0"CoolSwitch"=3D"0" > > http://stackoverflow.com/questions/2970683/disable-windows-and-alt-tab-ke= y-combos > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0*/ > > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0{ > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0//if (HasAltModifi= er(pkbdllhook->flags)) > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if ((pkbdllhook->f= lags & LLKHF_ALTDOWN) !=3D 0) > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0{ > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0// r= eturn new IntPtr(1); > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0retu= rn TRUE; Removing "return TRUE" and instead doing bHandle =3D 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.) > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0} > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0} > > 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? >