diff options
Diffstat (limited to 'include/input/Input.h')
-rw-r--r-- | include/input/Input.h | 50 |
1 files changed, 40 insertions, 10 deletions
diff --git a/include/input/Input.h b/include/input/Input.h index 7c662a7..793b414 100644 --- a/include/input/Input.h +++ b/include/input/Input.h @@ -22,11 +22,12 @@ */ #include <android/input.h> -#include <utils/Vector.h> +#include <utils/BitSet.h> #include <utils/KeyedVector.h> -#include <utils/Timers.h> #include <utils/RefBase.h> #include <utils/String8.h> +#include <utils/Timers.h> +#include <utils/Vector.h> /* * Additional private constants not defined in ndk/ui/input.h. @@ -65,6 +66,34 @@ enum { AINPUT_SOURCE_SWITCH = 0x80000000, }; +enum { + /** + * Constants for LEDs. Hidden from the API since we don't actually expose a way to interact + * with LEDs to developers + * + * NOTE: If you add LEDs here, you must also add them to KeycodeLabels.h + */ + + ALED_NUM_LOCK = 0x00, + ALED_CAPS_LOCK = 0x01, + ALED_SCROLL_LOCK = 0x02, + ALED_COMPOSE = 0x03, + ALED_KANA = 0x04, + ALED_SLEEP = 0x05, + ALED_SUSPEND = 0x06, + ALED_MUTE = 0x07, + ALED_MISC = 0x08, + ALED_MAIL = 0x09, + ALED_CHARGING = 0x0a, + ALED_CONTROLLER_1 = 0x10, + ALED_CONTROLLER_2 = 0x11, + ALED_CONTROLLER_3 = 0x12, + ALED_CONTROLLER_4 = 0x13, +}; + +/* Maximum number of controller LEDs we support */ +#define MAX_CONTROLLER_LEDS 4 + /* * SystemUiVisibility constants from View. */ @@ -149,13 +178,9 @@ enum { /* These flags are set by the input reader policy as it intercepts each event. */ - // Indicates that the screen was off when the event was received and the event - // should wake the device. - POLICY_FLAG_WOKE_HERE = 0x10000000, - - // Indicates that the screen was dim when the event was received and the event - // should brighten the device. - POLICY_FLAG_BRIGHT_HERE = 0x20000000, + // Indicates that the device was in an interactive state when the + // event was intercepted. + POLICY_FLAG_INTERACTIVE = 0x20000000, // Indicates that the event should be dispatched to applications. // The input event should still be sent to the InputDispatcher so that it can see all @@ -177,13 +202,18 @@ struct PointerCoords { float values[MAX_AXES]; inline void clear() { - bits = 0; + BitSet64::clear(bits); + } + + bool isEmpty() const { + return BitSet64::isEmpty(bits); } float getAxisValue(int32_t axis) const; status_t setAxisValue(int32_t axis, float value); void scale(float scale); + void applyOffset(float xOffset, float yOffset); inline float getX() const { return getAxisValue(AMOTION_EVENT_AXIS_X); |