diff options
| author | 2011-03-02 14:41:58 -0800 | |
|---|---|---|
| committer | 2011-03-02 15:37:57 -0800 | |
| commit | 05dc66ada6b61a6bdf806ffaa62617ac5394695d (patch) | |
| tree | a7e395476241706de31498185a5c2ccb979bcb54 /libs/ui/Keyboard.cpp | |
| parent | e43111fad31ad8e36a66df52a8c6002799996413 (diff) | |
Fade out the mouse pointer after inactivity or other events.
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
Diffstat (limited to 'libs/ui/Keyboard.cpp')
| -rw-r--r-- | libs/ui/Keyboard.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/libs/ui/Keyboard.cpp b/libs/ui/Keyboard.cpp index 8b6300a1ee70..600a951d5f90 100644 --- a/libs/ui/Keyboard.cpp +++ b/libs/ui/Keyboard.cpp @@ -322,5 +322,26 @@ int32_t updateMetaState(int32_t keyCode, bool down, int32_t oldMetaState) { } } +bool isMetaKey(int32_t keyCode) { + switch (keyCode) { + case AKEYCODE_ALT_LEFT: + case AKEYCODE_ALT_RIGHT: + case AKEYCODE_SHIFT_LEFT: + case AKEYCODE_SHIFT_RIGHT: + case AKEYCODE_SYM: + case AKEYCODE_FUNCTION: + case AKEYCODE_CTRL_LEFT: + case AKEYCODE_CTRL_RIGHT: + case AKEYCODE_META_LEFT: + case AKEYCODE_META_RIGHT: + case AKEYCODE_CAPS_LOCK: + case AKEYCODE_NUM_LOCK: + case AKEYCODE_SCROLL_LOCK: + return true; + default: + return false; + } +} + } // namespace android |