From 05dc66ada6b61a6bdf806ffaa62617ac5394695d Mon Sep 17 00:00:00 2001 From: Jeff Brown Date: Wed, 2 Mar 2011 14:41:58 -0800 Subject: 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 --- libs/ui/Keyboard.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'libs/ui/Keyboard.cpp') 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 -- cgit v1.2.3-59-g8ed1b