diff options
author | Arne Coucheron <arco68@gmail.com> | 2011-12-29 11:00:18 +0100 |
---|---|---|
committer | Arne Coucheron <arco68@gmail.com> | 2011-12-29 11:00:18 +0100 |
commit | c9b7945ba4effec69f349423190c878a25ee10e0 (patch) | |
tree | 2ebf753bdda2a272ae1cb7ee32f5d8904e46e1f6 /services | |
parent | f8e2430be2d6b3e88afd7190f6712f3bc1df0cbf (diff) | |
download | frameworks_base-c9b7945ba4effec69f349423190c878a25ee10e0.zip frameworks_base-c9b7945ba4effec69f349423190c878a25ee10e0.tar.gz frameworks_base-c9b7945ba4effec69f349423190c878a25ee10e0.tar.bz2 |
Process the BTN_MOUSE event
This is required in order to make the trackball on devices that has it to
work properly, like it does before ICS. In addition to this patch, you just
need an .idc file that matches the device name for your the trackball. You can
find it by either looking in a kernel log or a logcat.
For example, a device with a Crucial optical navigation pad, will be called
curcial-oj.idc
The .idc file should contain the following:
cursor.mode = navigation
cursor.orientationAware = 1
Place the file in /system/usr/idc folder.
Enable in BoardConfig.mk with BOARD_USE_LEGACY_TRACKPAD := true
Change-Id: I57e9912b9e4d6242c980c99f4fd28b0d50f19bb8
Diffstat (limited to 'services')
-rw-r--r-- | services/input/Android.mk | 4 | ||||
-rw-r--r-- | services/input/InputReader.cpp | 7 |
2 files changed, 11 insertions, 0 deletions
diff --git a/services/input/Android.mk b/services/input/Android.mk index 85dddb8..2323fb5 100644 --- a/services/input/Android.mk +++ b/services/input/Android.mk @@ -43,6 +43,10 @@ ifeq ($(BOARD_USE_LEGACY_TOUCHSCREEN),true) LOCAL_CFLAGS += -DLEGACY_TOUCHSCREEN endif +ifeq ($(BOARD_USE_LEGACY_TRACKPAD,true) +LOCAL_CFLAGS += -DLEGACY_TRACKPAD +endif + LOCAL_MODULE:= libinput LOCAL_MODULE_TAGS := optional diff --git a/services/input/InputReader.cpp b/services/input/InputReader.cpp index 408b805..b985178 100644 --- a/services/input/InputReader.cpp +++ b/services/input/InputReader.cpp @@ -2226,6 +2226,13 @@ void CursorInputMapper::process(const RawEvent* rawEvent) { if (rawEvent->type == EV_SYN && rawEvent->scanCode == SYN_REPORT) { sync(rawEvent->when); } +#ifdef LEGACY_TRACKPAD + // sync now since BTN_MOUSE is not necessarily followed by SYN_REPORT and + // we need to ensure that we report the up/down promptly. + else if (rawEvent->type == EV_KEY && rawEvent->scanCode == BTN_MOUSE) { + sync(rawEvent->when); + } +#endif } void CursorInputMapper::sync(nsecs_t when) { |