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

Commit 9e1328e6 authored by Lior Barenboim's avatar Lior Barenboim Committed by Gerrit - the friendly Code Review server
Browse files

Ultrasound: Filter out the special key event for digital pen hovering cursor

Ultrasound hovering cursor uses a special key event. This event is relevant
only for the InputReader that shows/hides the cursor accordingly.
Therefore, if the event  is sent from the ultrasound device it is filtered
out in the InputReader and is not sent to applications.

Change-Id: Id3a9718be6bdb144e80bfa32c0a18a9900071167
parent b3cf0462
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -58,6 +58,9 @@
#define INDENT4 "        "
#define INDENT5 "          "

// Ultrasound device name.
#define USF_DEVICE_NAME "usf_tsc"

namespace android {

// --- Constants ---
@@ -2088,6 +2091,11 @@ void KeyboardInputMapper::process(const RawEvent* rawEvent) {
                keyCode = AKEYCODE_UNKNOWN;
                flags = 0;
            }
            InputDeviceIdentifier identifier = getEventHub()->getDeviceIdentifier(rawEvent->deviceId);
            if ((identifier.name == USF_DEVICE_NAME) && (scanCode == BTN_USF_HOVERING_CURSOR))
            {
                break;
            }
            processKey(rawEvent->when, rawEvent->value != 0, keyCode, scanCode, flags);
        }
        break;