I'm detecting touch events anywhere on the screen by capturing the touch events in onTouchEvent(MotionEvent event). This captures all touch events but with a varying latency of 20-40 ms on a Pixel 3a. The latency also increases with higher CPU load. I wanted to know if there is another way to capture touch events with lower latency and possibly independent of CPU load. I don't have experience with NDK but would using NDK for this purpose provide lower latency?