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

Commit c9b7945b authored by Arne Coucheron's avatar Arne Coucheron
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: I57e9912b9e4d6242c980c99f4fd28b0d50f19bb8
parent f8e2430b
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -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
+7 −0
Original line number Diff line number Diff line
@@ -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) {