help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Sticky escape key


From: Bob Proulx
Subject: Re: Sticky escape key
Date: Fri, 18 Sep 2015 16:59:16 -0600
User-agent: Mutt/1.5.23 (2014-03-12)

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



reply via email to

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