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

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

Re: the second most recent key


From: Kevin Rodgers
Subject: Re: the second most recent key
Date: Thu, 26 Oct 2006 09:38:20 -0600
User-agent: Thunderbird 1.5.0.7 (Windows/20060909)

vb wrote:
Is there a way to know what was the key pressed immediately before the last key pressed.

Say there is a macro assigned to a certain key, and the function of this certain key depends on the key pressed immediately before the function was invoked.

Is there a way to know what key that was?

(let* ((recent-keys (recent-keys))
       (keys-length (length recent-keys))) ; should be 100
  (aref recent-keys (- keys-length (length (this-command-keys)) 1)))

--
Kevin





reply via email to

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