unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Bob Proulx <bob@proulx.com>
To: Surya Kiran Gullapalli <suryakiran.gullapalli@gmail.com>
Cc: help-gnu-emacs@gnu.org
Subject: Re: Sticky escape key
Date: Fri, 18 Sep 2015 16:59:16 -0600	[thread overview]
Message-ID: <20150918164750569537901@bob.proulx.com> (raw)
In-Reply-To: <CAKkRBO28HSw19DiWarUgR+nev7NvZnNtJ7-4WpdKf+KbtXys1g@mail.gmail.com>

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



  parent reply	other threads:[~2015-09-18 22:59 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-18 13:05 Sticky escape key Surya Kiran Gullapalli
2015-09-18 22:54 ` Emanuel Berg
2015-09-18 22:59 ` Bob Proulx [this message]
2015-09-19  3:09   ` Emanuel Berg
2015-09-20 23:37     ` Bob Proulx
2015-09-21  0:06       ` Emanuel Berg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150918164750569537901@bob.proulx.com \
    --to=bob@proulx.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=suryakiran.gullapalli@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).