Skip to content
Commit c9547607 authored by Toni Barzic's avatar Toni Barzic
Browse files

Implement EventStreamTrasformations for autoclick on mouse stop

The event stream transformer (AutoclickControlelr) observes motion
events from mouse in order to detect mouse movement. Once movement
is detected, a click event sequence gets scheduled with a delay. The
scheduled click gets rescheduled on every further detected mouse
movement, so the click is performed only when mouse movement stops.

Mouse movement detection has tolerance to jitter that may be caused
by user's poor motor control (that may prevent click ever being triggered
when mouse gets to target, or unwanted clicks when mouse is stationary).

Clicks are scheduled by posting delayed tasks to main loop. When
rescheduling click, previous tasks is not always removed and a new
created. Instead, if possible, new task is scheduled when previous,
delayed task is run. In order to do this, click scheduler keeps track
of scheduled click time and, when scheduled task is run, checks that
scheduled time is not greater than the current time (if it is, a new
delayed task is scheduled).

Detecting events from other input source types, or mouse events other
than movement (like clicks, scroll) cancels the scheduled click.

BUG=23113412

Change-Id: I8a72e768cd45cccb93c19476fe6e2c23e8e84f27
parent d10840fd
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment