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:34:46 +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 X-Trace: dough.gmane.org 1281062117 14123 80.91.229.12 (6 Aug 2010 02:35:17 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 6 Aug 2010 02:35:17 +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:35:16 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 1OhCmB-0005vt-0v for ged-emacs-devel@m.gmane.org; Fri, 06 Aug 2010 04:35:15 +0200 Original-Received: from localhost ([127.0.0.1]:54573 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OhCmA-0008TU-EI for ged-emacs-devel@m.gmane.org; Thu, 05 Aug 2010 22:35:14 -0400 Original-Received: from [140.186.70.92] (port=49861 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OhCm4-0008Sl-DE for emacs-devel@gnu.org; Thu, 05 Aug 2010 22:35:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OhCm3-00055b-8t for emacs-devel@gnu.org; Thu, 05 Aug 2010 22:35:08 -0400 Original-Received: from mail-qy0-f169.google.com ([209.85.216.169]:44381) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OhCm3-00055V-2v; Thu, 05 Aug 2010 22:35:07 -0400 Original-Received: by qyk12 with SMTP id 12so3847388qyk.0 for ; Thu, 05 Aug 2010 19:35:06 -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; bh=cX5xHiqhBs4Sidbm3z2rr51pPPsiWVSepaHGxm5kjxw=; b=oh/ItIuRXveykL+syvuCM7a+UmeBQo8GvOGcDpJqwwXiW733AyUdaHE3rNygA+nrpL cOUEXQVx9O+caFRg4AeBDE7bfY87qLqWMTFvwF7/fMXVVhVQk2N0wq+Lq+GuoQ3Ut0NS 60r6Q4bNzXBbM53DbZOIWDg7PpOUmZ+OPtzrQ= 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; b=UVd4wjZSa6345Tg9/UIL2NIMf9Y5Iixy4e2+6YCXWFWiAZJ244XC5CSQkm1DD9ynsL M+Mh38B1E0i8xCpYyrpAbBrdOtuO6BfQ6BdI5FkFX9rqGLKJak2N4mqw9HB8EifJlvlJ x7UqGuoqrQ2xw3ubW1JqQ05HGoWYlYt17GnMU= Original-Received: by 10.224.2.147 with SMTP id 19mr5545721qaj.61.1281062106248; Thu, 05 Aug 2010 19:35:06 -0700 (PDT) Original-Received: by 10.229.9.84 with HTTP; Thu, 5 Aug 2010 19:34:46 -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:128339 Archived-At: 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-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; } } 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?