|
From: | Vinicius Jose Latorre |
Subject: | Re: How to know if a key is pressed without getting it? |
Date: | Sun, 26 Sep 2010 19:41:29 -0300 |
User-agent: | Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.13) Gecko/20100914 SeaMonkey/2.0.8 |
Does anyone know how to know if a key is pressed without getting it in Emacs (like kbhit like function)?I don't know kbhit, so I'm not sure what you're asking. But it sounds like something that can't be done right, so if you give us a more general description of the problem at hand, we may be able to suggest a different solution.
The kbhit (keyboard hit) is a function that returns true if a key was pressed.
This function is used in Windows but there is also kbhit implementation for GNU/Linux.
The problem that I'm trying to fix is an specific slow down in whitespace when user holds space key pressed at end of a line. The slow down is caused by whitespace which call jit-font-lock-refontify each time the user press a space at end of line. If it is possible to detect that user is still pressing a key, I could fix the slow down by not calling jit-font-lock-refontify while user is pressing a key.
BTW, calling jit-font-lock-refontify in Emacs 22 didn't cause any slow down, but this happens in Emacs 23 and 24. Probably jit-font-lock-refontify or some part of font-lock was modified in Emacs 23.
[Prev in Thread] | Current Thread | [Next in Thread] |