* Ignoring a key event completely
@ 2008-05-12 14:16 Michael Schutte
2008-05-13 2:53 ` Kevin Rodgers
0 siblings, 1 reply; 5+ messages in thread
From: Michael Schutte @ 2008-05-12 14:16 UTC (permalink / raw)
To: help-gnu-emacs
Hi everybody,
The XKB layout I’m using [1] defines an additional modifier, the
Navigation key. Whenever I press it, Emacs responds by beeping and
printing “<key-17> is undefined”. I can suppress this by
global-set-keying it to 'ignore, but this does not turn it off
completely. In particular:
* Hitting the key still interrupts Isearch, which is very annoying.
* M-Nav, C-Nav and C-M-Nav also need to be 'ignored, which does not
seem very elegant to me.
* Messages appearing in the echo area are nuked when I press Nav (this
is minor, of course, but you get the idea).
So, I’m looking for a way to make Emacs completely forget about the key,
to make it as no-oppy as Shift, Ctrl, etc., but I simply can’t find out
how to do this on my own. Could anyone give me a clue?
[1] <https://neo.eigenheimstrasse.de/svn/linux/X/de>; grep for Mod4
Thanks in advance,
--
Michael Schutte <m.schutte.jr@gmail.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Ignoring a key event completely
2008-05-12 14:16 Ignoring a key event completely Michael Schutte
@ 2008-05-13 2:53 ` Kevin Rodgers
2008-05-13 7:44 ` Michael Schutte
0 siblings, 1 reply; 5+ messages in thread
From: Kevin Rodgers @ 2008-05-13 2:53 UTC (permalink / raw)
To: help-gnu-emacs
Michael Schutte wrote:
> Hi everybody,
>
> The XKB layout I’m using [1] defines an additional modifier, the
> Navigation key. Whenever I press it, Emacs responds by beeping and
> printing “<key-17> is undefined”. I can suppress this by
> global-set-keying it to 'ignore, but this does not turn it off
> completely. In particular:
>
> * Hitting the key still interrupts Isearch, which is very annoying.
> * M-Nav, C-Nav and C-M-Nav also need to be 'ignored, which does not
> seem very elegant to me.
> * Messages appearing in the echo area are nuked when I press Nav (this
> is minor, of course, but you get the idea).
>
> So, I’m looking for a way to make Emacs completely forget about the key,
> to make it as no-oppy as Shift, Ctrl, etc., but I simply can’t find out
> how to do this on my own. Could anyone give me a clue?
>
> [1] <https://neo.eigenheimstrasse.de/svn/linux/X/de>; grep for Mod4
I don't think I've ever been on a system that generates events like
<key-17>. What does Emacs display after typing `a', then the Navigation
key, then `C-h l'?
In any case, it looks like the Navigation key is not a modifier key like
Shift, Control, etc. So perhaps something like this will work:
(define-key special-event-map (kbd "<key-17>") 'ignore)
See the "Controlling Active Maps" and the "Special Events" nodes of the
Emacs Lisp manual.
--
Kevin Rodgers
Denver, Colorado, USA
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Ignoring a key event completely
2008-05-13 2:53 ` Kevin Rodgers
@ 2008-05-13 7:44 ` Michael Schutte
2008-05-13 12:54 ` Kevin Rodgers
0 siblings, 1 reply; 5+ messages in thread
From: Michael Schutte @ 2008-05-13 7:44 UTC (permalink / raw)
To: help-gnu-emacs
On Mon, May 12, 2008 at 08:53:39PM -0600, Kevin Rodgers wrote:
> I don't think I've ever been on a system that generates events like
> <key-17>. What does Emacs display after typing `a', then the Navigation
> key, then `C-h l'?
Just the thing one would expect: a <key-17> C-h l.
> In any case, it looks like the Navigation key is not a modifier key like
> Shift, Control, etc. So perhaps something like this will work:
>
> (define-key special-event-map (kbd "<key-17>") 'ignore)
>
> See the "Controlling Active Maps" and the "Special Events" nodes of the
> Emacs Lisp manual.
Yup, that’s exactly what I was looking for, thanks a lot! It still
needs the same treatment for M-, C- and S-, but I can live with that.
Cheers,
--
Michael Schutte <m.schutte.jr@gmail.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Ignoring a key event completely
2008-05-13 7:44 ` Michael Schutte
@ 2008-05-13 12:54 ` Kevin Rodgers
2008-05-14 15:03 ` Michael Schutte
0 siblings, 1 reply; 5+ messages in thread
From: Kevin Rodgers @ 2008-05-13 12:54 UTC (permalink / raw)
To: help-gnu-emacs
Michael Schutte wrote:
> On Mon, May 12, 2008 at 08:53:39PM -0600, Kevin Rodgers wrote:
>> I don't think I've ever been on a system that generates events like
>> <key-17>. What does Emacs display after typing `a', then the Navigation
>> key, then `C-h l'?
>
> Just the thing one would expect: a <key-17> C-h l.
Does `C-h v function-key-map' show a key sequence that is mapped to
[key-17]?
--
Kevin Rodgers
Denver, Colorado, USA
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Ignoring a key event completely
2008-05-13 12:54 ` Kevin Rodgers
@ 2008-05-14 15:03 ` Michael Schutte
0 siblings, 0 replies; 5+ messages in thread
From: Michael Schutte @ 2008-05-14 15:03 UTC (permalink / raw)
To: help-gnu-emacs
On Tue, May 13, 2008 at 06:54:09AM -0600, Kevin Rodgers wrote:
> Does `C-h v function-key-map' show a key sequence that is mapped to
> [key-17]?
No, it doesn’t. I also tried (define-key function-key-map [key-17] [])
now, but it seems to behave exactly the same way as doing it in
special-event-map (i.e. I have to see about C-, M-, etc. myself). Is
there some more magic I’m missing?
--
Michael Schutte <m.schutte.jr@gmail.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2008-05-14 15:03 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-12 14:16 Ignoring a key event completely Michael Schutte
2008-05-13 2:53 ` Kevin Rodgers
2008-05-13 7:44 ` Michael Schutte
2008-05-13 12:54 ` Kevin Rodgers
2008-05-14 15:03 ` Michael Schutte
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).