From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Bob Proulx Newsgroups: gmane.emacs.help Subject: Re: Sticky escape key Date: Fri, 18 Sep 2015 16:59:16 -0600 Message-ID: <20150918164750569537901@bob.proulx.com> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1442617174 18145 80.91.229.3 (18 Sep 2015 22:59:34 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 18 Sep 2015 22:59:34 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Surya Kiran Gullapalli Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Sep 19 00:59:34 2015 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Zd4cv-0004St-IU for geh-help-gnu-emacs@m.gmane.org; Sat, 19 Sep 2015 00:59:33 +0200 Original-Received: from localhost ([::1]:42336 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zd4cu-0004xz-W2 for geh-help-gnu-emacs@m.gmane.org; Fri, 18 Sep 2015 18:59:32 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50559) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zd4ck-0004w3-BI for help-gnu-emacs@gnu.org; Fri, 18 Sep 2015 18:59:23 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zd4cg-0004xY-Be for help-gnu-emacs@gnu.org; Fri, 18 Sep 2015 18:59:22 -0400 Original-Received: from joseki.proulx.com ([216.17.153.58]:46317) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zd4cg-0004xS-4p for help-gnu-emacs@gnu.org; Fri, 18 Sep 2015 18:59:18 -0400 Original-Received: from hysteria.proulx.com (hysteria.proulx.com [192.168.230.119]) by joseki.proulx.com (Postfix) with ESMTP id 0A0A621232; Fri, 18 Sep 2015 16:59:17 -0600 (MDT) Original-Received: by hysteria.proulx.com (Postfix, from userid 1000) id C14852DC42; Fri, 18 Sep 2015 16:59:16 -0600 (MDT) Mail-Followup-To: Surya Kiran Gullapalli , help-gnu-emacs@gnu.org Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 216.17.153.58 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:107242 Archived-At: Surya Kiran Gullapalli wrote: > I started using kinesis keyboard and mapped my left control key to escape > (near left thumb) and escape is the hyper key for me. You mapped it how? What did you do? Did you do it with the keyboard? With the terminal? With X and xmodmap? With setxkbmap? With a checkbox from your desktop manager dialog box? Some other method? I am thinking very hard but I haven't been eating enough fish and my telepathy is low at the moment. Or perhaps you aren't sending your thoughts hard enough? > I created some keybindings with the escape key. Everything is working fine. Do you mean M- somethings in emacs? Something like this? (This is just an example of creating a key binding using the escape key.) (global-set-key "\M-r" 'replace-regexp) ; orig 'move-to-window-line Or something different? > But the escape key is behaving as if it is a sticky key. I want it to > behave like a non-sticky key like ctrl or shift or alt. For me as a Unix/GNU/Linux user the xmodmap way works well. Here is my .xmodmap file that does this. ! Capslock becomes Control_L ! Control_L becomes Escape clear Lock clear Control keycode 37 = Escape NoSymbol Escape keycode 66 = Control_L NoSymbol Control_L add Control = Control_L Control_R But note that this is a very old-school way of doing things. It applies to people like me who are using X windows with a window manager such as FVWM or similar. It won't apply to people running heavy desktop managers such as GNOME nor MS-Windows nor probably other environments. I mostly provide this to show that many of us do this routinely and it works well. > Is there a way to do it in emacs ? (Kinesis doesn't seem to have that > option for escape key). Yes. No. Maybe. It can't be done for emacs running in a terminal because the terminal needs to know the difference between escape and control. Escape actually sends an escape whereas control modifies the character modified the same way that shift and meta/alt do. But graphical emacs has access to the entire keyboard input method. It can be done in graphical emacs. But I think that is bad because then it won't be applied uniformly to it being run in a terminal. And it won't be applied to other applications such as a bash command line shell. Therefore it is much better to remap the keyboard instead. Bob