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

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

Re: Very Specific Key Press Behaviour


From: Xah Lee
Subject: Re: Very Specific Key Press Behaviour
Date: Mon, 22 Jun 2009 22:20:42 -0700 (PDT)
User-agent: G2/1.0

On Jun 22, 1:37 pm, Nordlöw <per.nord...@gmail.com> wrote:
> On Jun 22, 10:33 pm, Nordlöw <per.nord...@gmail.com> wrote:
>
> > How can I bind an action to a key when it is pressed the n:th time,
> > possibly with different behaviour the 3:rd time compared to the 2:nd
> > and 1:st time. Can I combine it with define-prefix-command?
>
> > This is what I have now:
> > - TAB: Show Completion Menu - currently through define-prefix-command
> > ()
> > - TAB + X: Perform Completion of type X
>
> - TAB + X: here means press TAB, release it and then press X.

if i understand you correctly, you want the TAB key to perform a
action, and perform another action when TAB is followed by another
key. I don't think you can do that. Your tab key is a prefix key, you
cannot have prefix key perform a action.

you might hack it with OS's help, such as how Windows's Alt key
behaves or the Windows Log key, but that's kinda outside of emacs.

however, if you want a key combo to perform different action depending
how many times that key combo has been pressed, you can do it by
comparing the var last-command and this-command.

  Xah
∑ http://xahlee.org/

reply via email to

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