Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 95c24a20 authored by Arne Coucheron's avatar Arne Coucheron Committed by Gerrit Code Review
Browse files

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: I8684b94871a8bf9070dcda3538a239b111da7f5b
parent 375e26c5
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -44,6 +44,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
+7 −0
Original line number Diff line number Diff line
@@ -2458,6 +2458,13 @@ void CursorInputMapper::process(const RawEvent* rawEvent) {
    if (rawEvent->type == EV_SYN && rawEvent->code == 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->code == BTN_MOUSE) {
        sync(rawEvent->when);
    }
#endif
}

void CursorInputMapper::sync(nsecs_t when) {