- Home /
Get absolute position of touchpad
How can I get the absolute position touched on the touchpad? My laptop has a Synaptics touchpad and its fine if it only works on this touchpad. I'm trying to create an interaction with UI that will show as focused based on the section of the touchpad touched but I'm not sure where to begin getting the position touched.
Answer by XenoRo · Jan 22, 2019 at 01:37 AM
A physical touchpad will behave as a normal mouse. Just use Input.mousePosition
.
This is not to be confused with a touch-screen input technique called "touchpad" when a touchpad or controller stick is simulated on-screen.
I don't want the position of the mouse on the screen so Input.mousePosition won't work for my needs. I want a coordinate position of where inside the touchpad a finger is down. I want to split the touchpad into sections that focus a specific button when touched.
Are you talking about a physical touchpad or a virtual (on-screen) one? - If physical, then You want to get mouse position and check which section that position corresponds to. If virtual, same thing, but relative to the virtual touchpad.
Your answer
Follow this Question
Related Questions
How can we make touch controls like Hole.io/ Bumper.io? 0 Answers
Help In Making a SphereCast for 3D Tire! Working RayCast Script included! 0 Answers
When pressing a button, it counts as pressing the screen and the button [New Input System] 0 Answers
How to get ScrollWheel values using a laptop touchpad? 1 Answer
CrossPlatformInputManager.GetAxis() always returns 0 5 Answers