From: Till Straumann <hidden> Date: 2002-11-29 01:34:32
OK, here's a trivial patch (linux-2.4.18) for disabling/ignoring
the mouse/trackpad while typing. It can be very convenient on notebook
computers.
NOTE: this patch works only on machines using the 'new' input layer
(e.g. Apple Powerbook, ibook, ...)
The holdoff time can be adjusted via sysctl/procfs - see description
in the patch file.
-- Till
PS: Please CC me if there are comments/questions; I'm not subscribed to
this mailing list.
On Thu, Nov 28, 2002 at 05:34:32PM -0800, Till Straumann wrote:
/proc/sys/dev/input/mouse_holdoff_ms
for tuning the time period during which the mouse is to
be ignored after a keystroke (valid range from
0 [disabled] ... 3000 ).
NOTE: Official 'SYSCTL' numbers should be assigned
for the 'input' and 'input/mouse_holdoff_ms' nodes.
From: Michel Dänzer <hidden> Date: 2002-12-03 01:47:06
On Fre, 2002-11-29 at 02:34, Till Straumann wrote:
+ if ( jiffies - mouse_holdoff_last_jiffie < mouse_holdoff_jiffies )
+ return;
+ /* Note: we could lose mouse events when the jiffie counter rolls over... */
I think the difference is always correct.
--
Earthling Michel Dänzer (MrCooper)/ Debian GNU/Linux (powerpc) developer
XFree86 and DRI project member / CS student, Free Software enthusiast
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
From: Till Straumann <hidden> Date: 2002-12-03 05:03:44
Michel Dänzer wrote:
On Fre, 2002-11-29 at 02:34, Till Straumann wrote:
quoted
+ if ( jiffies - mouse_holdoff_last_jiffie < mouse_holdoff_jiffies )
+ return;
+ /* Note: we could lose mouse events when the jiffie counter rolls over... */
I think the difference is always correct.
No: if no key is pressed for (any integer multiple of) 2^32 jiffies then
mouse events are ignored during a short period of time following the
rollover ;-)
[ i.e. the rollover of the difference, not the jiffies; the true
relation being
(jiffies - mouse_holdoff_last_jiffie) % 2^32 < mouse_holdoff_jiffies
]
Anyways: the patch has another problem: the trivial version cannot deal
with
- emulated mouse buttons (ignored because input_event() first receives
a key event which is sent to the keyboard handler who remaps it to a
mouse/button event to be ignored since it happens shortly after the
key event triggering it)
- 'modifiers' (Shift, Ctrl & friends). All keys seem to be
'auto-repeated' by the input driver resulting in repeated
key events while a modifier is pressed, hence causing the trivial
patch to ignore mouse events while a modifier key is held down.
I'm working on an improved version supporting a (configurable but
reasonably defaulted) list of keys who are to be considered 'modifiers'.
-- Till
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/