summaryrefslogtreecommitdiffstats
path: root/services/input/EventHub.h
Commit message (Collapse)AuthorAgeFilesLines
* Remove no longer needed EventHub usleep() optimization.Jeff Brown2012-01-191-3/+0
| | | | | | | | This optimization is no longer needed now that the kernel evdev driver's poll() implementation only wakes up the poll after the final sync. Change-Id: If237776861df9cfac3086e744d3bbf3484d4c53b
* Eliminate hw.keyboards system properties.Jeff Brown2011-11-151-2/+4
| | | | | | | | | | | | Stop using system properties to publish information about the key character map path. Instead, we can retrieve it on demand by asking the window manager. It was possible to exhaust the supply of system properties when repeatedly adding and removing input devices. Bug: 5532806 Change-Id: Idd361a24ad7db2edc185c8546db7fb05f9c28669
* Support composite touch / joystick devices better.Jeff Brown2011-08-311-0/+6
| | | | | | | | This change enables the joystick input mapper to handle any axes that are not claimed by the touch input mapper, which makes auxiliary controls such as wheels / knobs accessible. Change-Id: I01ee7f342ac91acfcb4ccb6676fd52b3d5bf31a0
* Add input system to Watchdog.Jeff Brown2011-08-101-0/+5
| | | | | | Bug: 5094994 Change-Id: I153866958efc64ac19bda8b997c1c9f6ad425ec4
* Fix getSwitchState and others to check bitmasks.Jeff Brown2011-08-101-7/+0
| | | | | | | | | | Bug: 5149443 Removed some dead code and unnecessary checks, such as checks for non-nullity of arrays that used to be dynamically allocated once upon a time but are now part of the Device object itself. Change-Id: I531116e816772d7c5030d22da0c8e1d7dcfba778
* Handle stylus buttons and tool types.Jeff Brown2011-07-251-0/+2
| | | | | | | | | | | | | | | | Added TOOL_TYPE_ERASER. Refactored the InputReader to share more code between the various input mappers that handle button states and to simplify the accumulator implementations by having each one only handle a single type of input. Removed the concept of direct/indirect tool types from the API. If we add it back, it should be done in a manner that is orthogonal to the tool type itself, perhaps as a flags field on the pointer. The device source may well provide sufficient information anyhow. Change-Id: I811c22d95e8304269b6ee4f6d11a6b04f3cfc1b2
* Query input device for initial slot index.Jeff Brown2011-07-011-0/+4
| | | | | | | | | | | This fixes a problem where touches can get stuck because the driver and the framework have different ideas of what the initial slot index is. The framework assumed it was slot 0 but it could in principle be any slot, such as slot 1. When that happened, the framework would start tracking the first touch as slot 0, but it might never receive an "up" for that slot. Change-Id: Idaffc4534b275d66b9d4360987b28dc2d0f63218
* EventHub code cleanup.Jeff Brown2011-06-141-37/+58
| | | | | | | | | Use epoll_wait() instead of poll(). Dropped all support for non-Linux platforms. Added a wake-up protocol so that the InputReader can wake up the event loop immediately as needed. Change-Id: Ibf84337bcceb3c2df068c5c637de42a319786d66
* Take advantage of updated linux/input.h kernel headers.Jeff Brown2011-06-131-33/+2
| | | | Change-Id: I72d2ef82de5c504d46b0cdb57aa43bbd0d769174
* resolved conflicts for merge of ca2b552d to masterJeff Brown2011-06-031-5/+12
|\ | | | | | | Change-Id: I2f3693a59042ac5aa2d7bcdc3a504c78dc99a18b
| * Add a preference panel for mouse speed.Jeff Brown2011-06-021-5/+12
| | | | | | | | | | Bug: 4124987 Change-Id: I3ce175d268a1d043cf5878481261b1049a15a149
| * Optimize EventHub to process events in big chunks. (DO NOT MERGE)Jeff Brown2011-05-241-8/+10
| | | | | | | | | | | | | | When 10 fingers are down, reduces the CPU time spent by the InputReader thread from ~30% to ~5% on Stingray. Change-Id: I42ee5c67b8521af715cbab43e763a4af4eb1f914
| * Refactor how timeouts are calculated. (DO NOT MERGE)Jeff Brown2011-05-231-2/+7
| | | | | | | | | | | | | | | | Added a timeout mechanism to EventHub and InputReader so that InputMappers can request timeouts to perform delayed processing of input when needed. Change-Id: I89c1171c9326c6e413042e3ee13aa9f7f1fc0454
| * Fix off by one errors in touch motion ranges. (DO NOT MERGE)Jeff Brown2011-03-091-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * Joystick tweaks. (DO NOT MERGE)Jeff Brown2011-03-041-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Ensure that the joystick can always reach -1.0, 0.0 and 1.0 positions even when noise filtering is applied. (Bug: 3514510) Add support for a few more standard axes. Add additional mapping modes for axes. Some axes are inverted from standard interpretation or are actually intended to be split into two distict axes such as left/right trigger controls or accelerator/brake. Add key layout file for a G25 racing wheel and XBox 360 controller to tweak behavior. They work fine without them but the axis mappings are not ideal. Change-Id: I0fddd90309af4dc14d35f34fe99ed6e521c0b7c7
* | Input device protocol enhancements.Jeff Brown2011-05-241-17/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | Added support for Linux multitouch protocol B (slots). Added support for using the device's input properties as a hint to determine the intended usage of a touch device. Added support for the ABS_MT_DISTANCE axis. Fixed a bug reporting the presence of the orientation axis. Change-Id: Icf7b5a5a0f1a9cdf6ad2b35be8ea0c1a35815d48
* | Optimize EventHub to process events in big chunks.Jeff Brown2011-03-181-8/+10
| | | | | | | | | | | | | | When 10 fingers are down, reduces the CPU time spent by the InputReader thread from ~30% to ~5% on Stingray. Change-Id: Icdf7c91cd5d9039ac3beb38ba9021a05e7fabc80
* | Refactor how timeouts are calculated.Jeff Brown2011-03-171-2/+7
| | | | | | | | | | | | | | | | Added a timeout mechanism to EventHub and InputReader so that InputMappers can request timeouts to perform delayed processing of input when needed. Change-Id: Iec2045baaf4e67690b15eef3c09a58d5cac76897
* | Joystick tweaks.Jeff Brown2011-03-041-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Ensure that the joystick can always reach -1.0, 0.0 and 1.0 positions even when noise filtering is applied. (Bug: 3514510) Add support for a few more standard axes. Add additional mapping modes for axes. Some axes are inverted from standard interpretation or are actually intended to be split into two distict axes such as left/right trigger controls or accelerator/brake. Add key layout file for a G25 racing wheel and XBox 360 controller to tweak behavior. They work fine without them but the axis mappings are not ideal. Change-Id: Id4c86a0a272331c680039a9bde6815bb7eba44ab
* | Fix off by one errors in touch motion ranges.Jeff Brown2011-03-031-2/+0
|/ | | | | | | | | | | | | | | | | | | 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
* Wake screen from external HID peripherals.Jeff Brown2011-03-021-0/+5
| | | | | | | | | | | | | | | | | | Added some plumbing to enable the policy to intercept motion events when the screen is off to handle wakeup if needed. Added a basic concept of an external device to limit the scope of the wakeup policy to external devices only. The wakeup policy for internal devices should be based on explicit rules such as policy flags in key layout files. Moved isTouchEvent to native. Ensure the dispatcher sends the right event type to userActivity for non-touch pointer events like HOVER_MOVE and SCROLL. Bug: 3193114 Change-Id: I15dbd48a16810dfaf226ff7ad117d46908ca4f86
* Add support for mouse hover and scroll wheel.Jeff Brown2011-02-251-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Dispatch ACTION_HOVER_MOVE and ACTION_SCROLL through the View hierarchy as onGenericTouchEvent. Pointer events dispatched this way are delivered to the view under the pointer. Non-pointer events continue to be delivered to the focused view. Added scroll wheel support to AbsListView, ScrollView, HorizontalScrollView and WebView. Shift+VSCROLL is translated to HSCROLL as appropriate. Added logging of new pointer events in PointerLocationView. Fixed a problem in EventHub when a USB device is removed that resulted in a long stream of ENODEV errors being logged until INotify noticed the device was gone. Note that the new events are not supported by wallpapers at this time because the wallpaper engine only delivers touch events. Make all mouse buttons behave identically. (Effectively we only support one button.) Change-Id: I9ab445ffb63c813fcb07db6693987b02475f3756
* Add new hover move action and scroll wheel plumbing.Jeff Brown2011-02-191-0/+5
| | | | | | | | | | | | Added support for tracking the mouse position even when the mouse button is not pressed. To avoid confusing existing applications, mouse movements are reported using the new ACTION_HOVER_MOVE action when the mouse button is not pressed. Added some more plumbing for the scroll wheel axes. The values are reported to Views but they are not yet handled by the framework. Change-Id: I1706be850d25cf34e5adf880bbed5cc3265cf4b1
* Add new axes for joysticks and mouse wheels.Jeff Brown2011-02-191-4/+8
| | | | | | | | | | | | | | | | | | Added API on InputDevice to query the set of axes available. Added API on KeyEvent and MotionEvent to convert keycodes and axes to symbolic name strings for diagnostic purposes. Added API on KeyEvent to query if a given key code is a gamepad button. Added a new "axis" element to key layout files to specify the mapping between raw absolute axis values and motion axis ids. Expanded the axis bitfield to 64bits to allow for future growth. Modified the Makefile for keyboard prebuilts to run the keymap validation tool during the build. Added layouts for two game controllers. Added default actions for game pad button keys. Added more tests. Fixed a bunch of bugs. Change-Id: I73f9166c3b3c5bcf4970845b58088ad467525525
* am 12b2dc90: am b1e0a870: Merge "Fix crashes caused by some input devices." ↵Jeff Brown2011-01-251-3/+3
|\ | | | | | | | | | | | | into honeycomb * commit '12b2dc90883ef4f930a17907acdef3677b0598a5': Fix crashes caused by some input devices.
| * Fix crashes caused by some input devices.Jeff Brown2011-01-251-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The touch screen sometimes reports more than 10 pointers even though that's all we asked for. When this happens, we start dropping events with more than 10 pointers. This confuses applications and causes them to crash. Raised the limit to 16 pointers. Bug: 3331247 The default behavior was to identify all touch devices as touch screens. External devices that are plugged in are more likely to be touch pads not attached to a screen. Changed the default to be a touch pad and renamed some internal constants to avoid confusion. A certain mouse happens to also behave like a touch pad. That caused problems because we would see multiple concurrent traces of motion events coming from the same input device so we would batch them up. Added code to ensure that we don't batch events unless they come from the same *source* in addition to coming from the same *device*. Due to batching or misbehaving drivers, it's possible for the set of pointer ids to be different from what we expect when it comes time to split motion events across windows. As a result, we can generate motion events with 0 pointers. When we try to deliver those events, we cause an error in the InputTransport so we tear down the InputChannel and kill the application. Added code to check out assumption about pointer ids and drop the event gracefully instead. Patched up the tests to take into account the change in default behavior for identifying touch screens and touch pads. Change-Id: Ic364bd4cb4cc6335d4a1213a26d6bdadc7e33505
* | Add joystick support to framework.Jeff Brown2011-01-171-2/+5
|/ | | | Change-Id: I95374436708752e1a9cff3f85c5b9bc3e0987961
* Mouse pointer integration.Jeff Brown2011-01-041-0/+327
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