summaryrefslogtreecommitdiffstats
path: root/services/input/PointerController.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Rename (IF_)LOGD(_IF) to (IF_)ALOGD(_IF) DO NOT MERGESteve Block2012-01-031-6/+6
| | | | | | | See https://android-git.corp.google.com/g/156016 Bug: 5449033 Change-Id: I4c4e33bb9df3e39e11cd985e193e6fbab4635298
* Refactor input reader to add stylus support.Jeff Brown2011-07-311-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug: 5064702 Introduced the concept of an InputListener to further decouple the InputReader from the InputDispatcher. The InputListener exposes just the minimum interface that the InputReader needs to communicate with the outside world. The InputReader passes arguments to the InputListener by reference, which makes it easy to queue them up. Consolidated all of the InputReader locks into one simple global Mutex. The reason this wasn't done before was due to potential re-entrance in outbound calls to the InputDispatcher. To fix this, the InputReader now queues up all of the events it wants to send using a QueuedInputListener, then flushes them outside of the critical section after all of the event processing is finished. Removing all of the InputMapper locks greatly simplifies the implementation. Added tests for new stylus features such as buttons, tool types, and hovering. Added some helpers to BitSet32 to handle common code patterns like finding the first marked bit and clearing it. Fixed a bug in VelocityTracker where the wrong pointer trace could get cleared when handling ACTION_POINTER_DOWN. Oops. Changed PointerCoords so it no longer stores useless zero axis values. Removed editAxisValue because it is not very useful when all zero value axes are absent and therefore cannot be edited in place. Added dispatch of stylus hover events. Added support for distance and tool types. Change-Id: I4cf14d134fcb1db7d10be5f2af7b37deef8f8468
* am 55cc25c1: am 797dc698: am b92dcf9c: Merge "Simplify spot tracking logic. ↵Jeff Brown2011-06-071-4/+4
|\ | | | | | | | | | | | | Bug: 4124987" into honeycomb-mr2 * commit '55cc25c12c45e8ffb65d2275cc0b6941b68db9df': Simplify spot tracking logic. Bug: 4124987
| * Simplify spot tracking logic.Jeff Brown2011-06-061-4/+4
| | | | | | | | | | | | | | | | | | Bug: 4124987 Since spots are now one-to-one with the touch gesture points, we can eliminate a lot of redundant logic that assumed they weren't. Change-Id: Ic60d8d0898c285317f480bc8fb17fb9797770e69
* | am 3f5b95b0: am a4e74744: am fa574c0e: Merge "Touch pad UX improvements." ↵Jeff Brown2011-05-311-19/+37
|\ \ | |/ | | | | | | | | | | into honeycomb-mr2 * commit '3f5b95b05efcf7ab2e8f193649b841dc1786f2ef': Touch pad UX improvements.
| * Touch pad UX improvements.Jeff Brown2011-05-251-19/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | Fade the pointer spot when swiping or performing a freeform gesture. Support configuring the gesture mode in the device IDC file. Added workaround for devices that report individual finger movements one at a time instead of all at once. Bug: 4124987 Change-Id: I44628b00382ad59306e4ec5c4717d69cc6fbebb8
| * Initial checkin of spot presentation for touchpad gestures. (DO NOT MERGE)Jeff Brown2011-05-251-72/+301
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added a new PointerIcon API (hidden for now) for loading pointer icons. Fixed a starvation problem in the native Looper's sendMessage implementation which caused new messages to be posted ahead of old messages sent with sendMessageDelayed. Redesigned the touch pad gestures to be defined in terms of more fluid finger / spot movements. The objective is to reinforce the natural mapping between fingers and spots which means there must not be any discontinuities in spot motion relative to the fingers. Removed the SpotController stub and folded its responsibilities into PointerController. Change-Id: Ib647dbd7a57a7f30dd9c6e2c260df51d7bbdd18e
| * Add a sprite controller. (DO NOT MERGE)Jeff Brown2011-05-251-193/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Refactored PointerController to extract the surface management code to a new component called a SpriteController so that it can be used to move finger tracking spots around the screen as well. The SpriteController is designed to fully decouple the client from any latency introduced by surface transactions and drawing. All sprite updates are performed asynchronously on the Looper using a copy of the sprite state. Added a stub SpotController implementation for touch pad UX. It will be implemented in a subsequent patch. Fixed a little bug in pointer orientation changes when entering DISPLAY_ORIENTATION_90 the x offset was clobbered. Change-Id: I6d59d80df9af61e93af50290e7776337d10c9d5a
| * Fix off by one errors in touch motion ranges. (DO NOT MERGE)Jeff Brown2011-03-091-28/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Report inclusive minimum and maximum ranges for all axes including X and Y. Set mouse pointer bounds to 0..width-1, 0..height-1. Rotate touch and mouse positions more carefully, paying attention to the maximum bounds when calculating the complement of an axis. Simplified the InputReader somewhat and removed support for a couple of poorly defined input device configuration parameters. We now assume that the touch device provides useful absolute axis ranges for the X and Y axes since the alternative does not actually make sense. Bug: 3413541 Change-Id: I121d28a125c4f9618cb283dc460d33ff1a907023
* | Add initial API for stylus and mouse buttons.Jeff Brown2011-05-131-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added the concept of pointer properties in a MotionEvent. This is currently used to track the pointer tool type to enable applications to distinguish finger touches from a stylus. Button states are also reported to application as part of touch events. There are no new actions for detecting changes in button states. The application should instead query the button state from the MotionEvent and take appropriate action as needed. A good time to check the button state is on ACTION_DOWN. As a side-effect, applications that do not support multiple buttons will treat primary, secondary and tertiary buttons identically for all touch events. The back button on the mouse is mapped to KEYCODE_BACK and the forward button is mapped to KEYCODE_FORWARD. Added basic plumbing for the secondary mouse button to invoke the context menu, particularly in lists. Added clamp and split methods on MotionEvent to take care of common filtering operations so we don't have them scattered in multiple places across the framework. Bug: 4260011 Change-Id: Ie992b4d4e00c8f2e76b961da0a902145b27f6d83
* | Initial checkin of spot presentation for touchpad gestures.Jeff Brown2011-04-191-72/+301
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added a new PointerIcon API (hidden for now) for loading pointer icons. Fixed a starvation problem in the native Looper's sendMessage implementation which caused new messages to be posted ahead of old messages sent with sendMessageDelayed. Redesigned the touch pad gestures to be defined in terms of more fluid finger / spot movements. The objective is to reinforce the natural mapping between fingers and spots which means there must not be any discontinuities in spot motion relative to the fingers. Removed the SpotController stub and folded its responsibilities into PointerController. Change-Id: I5126b1e69d95252fda7f2a684c9287e239a57163
* | Add a sprite controller.Jeff Brown2011-04-111-193/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Refactored PointerController to extract the surface management code to a new component called a SpriteController so that it can be used to move finger tracking spots around the screen as well. The SpriteController is designed to fully decouple the client from any latency introduced by surface transactions and drawing. All sprite updates are performed asynchronously on the Looper using a copy of the sprite state. Added a stub SpotController implementation for touch pad UX. It will be implemented in a subsequent patch. Fixed a little bug in pointer orientation changes when entering DISPLAY_ORIENTATION_90 the x offset was clobbered. Change-Id: Ib25d162d577c9b354cb74d5d761c3c9f9f438d42
* | Fix off by one errors in touch motion ranges.Jeff Brown2011-03-031-28/+33
|/ | | | | | | | | | | | | | | | | | | Report inclusive minimum and maximum ranges for all axes including X and Y. Set mouse pointer bounds to 0..width-1, 0..height-1. Rotate touch and mouse positions more carefully, paying attention to the maximum bounds when calculating the complement of an axis. Simplified the InputReader somewhat and removed support for a couple of poorly defined input device configuration parameters. We now assume that the touch device provides useful absolute axis ranges for the X and Y axes since the alternative does not actually make sense. Bug: 3413541 Change-Id: I682ce3729e4473de7f1bcf8addb49a3f4484126f
* Fade out the mouse pointer after inactivity or other events.Jeff Brown2011-03-021-4/+114
| | | | | | | | | | | | | | Fades out the mouse pointer: - after 15 seconds of inactivity normally - after 3 seconds of inactivity in lights out mode - after a non-modifier key down - after a touch down Extended the native Looper to support enqueuing time delayed messages. This is used by the PointerController to control pointer fade timing. Change-Id: I87792fea7dbe2d9376c78cf354fe3189a484d9da
* Mouse pointer tweaks.Jeff Brown2011-01-171-2/+10
| | | | | | | | Make pointer arrow brighter. Deep copy the pointer icon bitmap since it turns out that the original shared pixels can be deleted by other code. Change-Id: I77fbf61d1dace723f3c8c9808941e9e31d8db352
* Mouse pointer integration.Jeff Brown2011-01-041-0/+407
Added support for loading the pointer icon from a resource. Moved the system server related bits of the input manager out of libui and into libinput since they do not need to be linked into applications. Change-Id: Iec11e0725b3add2b905c51f8ea2c3b4b0d1a2d67