emacs-devel
[Top][All Lists]
Advanced

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

Re: How to know if a key is pressed without getting it?


From: Ted Zlatanov
Subject: Re: How to know if a key is pressed without getting it?
Date: Sun, 26 Sep 2010 20:20:36 -0500
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/24.0.50 (gnu/linux)

On Sun, 26 Sep 2010 19:41:29 -0300 Vinicius Jose Latorre <address@hidden> 
wrote: 

VJL> The problem that I'm trying to fix is an specific slow down in
VJL> whitespace when user holds space key pressed at end of a line. The
VJL> slow down is caused by whitespace which call jit-font-lock-refontify
VJL> each time the user press a space at end of line. If it is possible to
VJL> detect that user is still pressing a key, I could fix the slow down by
VJL> not calling jit-font-lock-refontify while user is pressing a key.

I wonder if this could be handled with an Emacs facility, e.g.:

; triggers when it's held less than 30 secs
(global-set-key [(hold < 30.0) (shift f4)] 'something)

; triggers when it's held 30 secs or more
(global-set-key [(hold >= 30.0) (shift f4)] 'something-else)

Just an idea...  Forgive the noise if it's nonsense :)

Ted




reply via email to

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