1 /* dstep -I/path/to/ndk-r9d/platforms/android-9/arch-x86/usr/include -I/path/to/ndk-r9d/toolchains/llvm-3.4/prebuilt/linux-x86/lib/clang/3.4/include /path/to/ndk-r9d/platforms/android-9/arch-x86/usr/include/android/input.h -o input.d*/
2 
3 module android.input;
4 
5 import android.keycodes, android.looper;
6 
7 version (Android):
8 extern (C):
9 @system:
10 nothrow:
11 @nogc:
12 
13 enum
14 {
15     AKEY_STATE_UNKNOWN = -1,
16     AKEY_STATE_UP = 0,
17     AKEY_STATE_DOWN = 1,
18     AKEY_STATE_VIRTUAL = 2
19 }
20 
21 enum
22 {
23     AMETA_NONE = 0,
24     AMETA_ALT_ON = 2,
25     AMETA_ALT_LEFT_ON = 16,
26     AMETA_ALT_RIGHT_ON = 32,
27     AMETA_SHIFT_ON = 1,
28     AMETA_SHIFT_LEFT_ON = 64,
29     AMETA_SHIFT_RIGHT_ON = 128,
30     AMETA_SYM_ON = 4
31 }
32 
33 enum
34 {
35     AINPUT_EVENT_TYPE_KEY = 1,
36     AINPUT_EVENT_TYPE_MOTION = 2
37 }
38 
39 enum
40 {
41     AKEY_EVENT_ACTION_DOWN = 0,
42     AKEY_EVENT_ACTION_UP = 1,
43     AKEY_EVENT_ACTION_MULTIPLE = 2
44 }
45 
46 enum
47 {
48     AKEY_EVENT_FLAG_WOKE_HERE = 1,
49     AKEY_EVENT_FLAG_SOFT_KEYBOARD = 2,
50     AKEY_EVENT_FLAG_KEEP_TOUCH_MODE = 4,
51     AKEY_EVENT_FLAG_FROM_SYSTEM = 8,
52     AKEY_EVENT_FLAG_EDITOR_ACTION = 16,
53     AKEY_EVENT_FLAG_CANCELED = 32,
54     AKEY_EVENT_FLAG_VIRTUAL_HARD_KEY = 64,
55     AKEY_EVENT_FLAG_LONG_PRESS = 128,
56     AKEY_EVENT_FLAG_CANCELED_LONG_PRESS = 256,
57     AKEY_EVENT_FLAG_TRACKING = 512
58 }
59 
60 enum AMOTION_EVENT_ACTION_POINTER_INDEX_SHIFT = 8;
61 
62 enum
63 {
64     AMOTION_EVENT_ACTION_MASK = 255,
65     AMOTION_EVENT_ACTION_POINTER_INDEX_MASK = 65280,
66     AMOTION_EVENT_ACTION_DOWN = 0,
67     AMOTION_EVENT_ACTION_UP = 1,
68     AMOTION_EVENT_ACTION_MOVE = 2,
69     AMOTION_EVENT_ACTION_CANCEL = 3,
70     AMOTION_EVENT_ACTION_OUTSIDE = 4,
71     AMOTION_EVENT_ACTION_POINTER_DOWN = 5,
72     AMOTION_EVENT_ACTION_POINTER_UP = 6
73 }
74 
75 enum
76 {
77     AMOTION_EVENT_FLAG_WINDOW_IS_OBSCURED = 1
78 }
79 
80 enum
81 {
82     AMOTION_EVENT_EDGE_FLAG_NONE = 0,
83     AMOTION_EVENT_EDGE_FLAG_TOP = 1,
84     AMOTION_EVENT_EDGE_FLAG_BOTTOM = 2,
85     AMOTION_EVENT_EDGE_FLAG_LEFT = 4,
86     AMOTION_EVENT_EDGE_FLAG_RIGHT = 8
87 }
88 
89 enum
90 {
91     AINPUT_SOURCE_CLASS_MASK = 255,
92     AINPUT_SOURCE_CLASS_BUTTON = 1,
93     AINPUT_SOURCE_CLASS_POINTER = 2,
94     AINPUT_SOURCE_CLASS_NAVIGATION = 4,
95     AINPUT_SOURCE_CLASS_POSITION = 8
96 }
97 
98 enum
99 {
100     AINPUT_SOURCE_UNKNOWN = 0,
101     AINPUT_SOURCE_KEYBOARD = 257,
102     AINPUT_SOURCE_DPAD = 513,
103     AINPUT_SOURCE_TOUCHSCREEN = 4098,
104     AINPUT_SOURCE_MOUSE = 8194,
105     AINPUT_SOURCE_TRACKBALL = 65540,
106     AINPUT_SOURCE_TOUCHPAD = 1048584,
107     AINPUT_SOURCE_ANY = 0xffffff00
108 }
109 
110 enum
111 {
112     AINPUT_KEYBOARD_TYPE_NONE = 0,
113     AINPUT_KEYBOARD_TYPE_NON_ALPHABETIC = 1,
114     AINPUT_KEYBOARD_TYPE_ALPHABETIC = 2
115 }
116 
117 enum
118 {
119     AINPUT_MOTION_RANGE_X = 0,
120     AINPUT_MOTION_RANGE_Y = 1,
121     AINPUT_MOTION_RANGE_PRESSURE = 2,
122     AINPUT_MOTION_RANGE_SIZE = 3,
123     AINPUT_MOTION_RANGE_TOUCH_MAJOR = 4,
124     AINPUT_MOTION_RANGE_TOUCH_MINOR = 5,
125     AINPUT_MOTION_RANGE_TOOL_MAJOR = 6,
126     AINPUT_MOTION_RANGE_TOOL_MINOR = 7,
127     AINPUT_MOTION_RANGE_ORIENTATION = 8
128 }
129 
130 struct AInputQueue;
131 struct AInputEvent;
132 
133 int AInputEvent_getType(const(AInputEvent)* event);
134 int AInputEvent_getDeviceId(const(AInputEvent)* event);
135 int AInputEvent_getSource(const(AInputEvent)* event);
136 int AKeyEvent_getAction(const(AInputEvent)* key_event);
137 int AKeyEvent_getFlags(const(AInputEvent)* key_event);
138 int AKeyEvent_getKeyCode(const(AInputEvent)* key_event);
139 int AKeyEvent_getScanCode(const(AInputEvent)* key_event);
140 int AKeyEvent_getMetaState(const(AInputEvent)* key_event);
141 int AKeyEvent_getRepeatCount(const(AInputEvent)* key_event);
142 long AKeyEvent_getDownTime(const(AInputEvent)* key_event);
143 long AKeyEvent_getEventTime(const(AInputEvent)* key_event);
144 int AMotionEvent_getAction(const(AInputEvent)* motion_event);
145 int AMotionEvent_getFlags(const(AInputEvent)* motion_event);
146 int AMotionEvent_getMetaState(const(AInputEvent)* motion_event);
147 int AMotionEvent_getEdgeFlags(const(AInputEvent)* motion_event);
148 long AMotionEvent_getDownTime(const(AInputEvent)* motion_event);
149 long AMotionEvent_getEventTime(const(AInputEvent)* motion_event);
150 float AMotionEvent_getXOffset(const(AInputEvent)* motion_event);
151 float AMotionEvent_getYOffset(const(AInputEvent)* motion_event);
152 float AMotionEvent_getXPrecision(const(AInputEvent)* motion_event);
153 float AMotionEvent_getYPrecision(const(AInputEvent)* motion_event);
154 size_t AMotionEvent_getPointerCount(const(AInputEvent)* motion_event);
155 int AMotionEvent_getPointerId(const(AInputEvent)* motion_event, size_t pointer_index);
156 float AMotionEvent_getRawX(const(AInputEvent)* motion_event, size_t pointer_index);
157 float AMotionEvent_getRawY(const(AInputEvent)* motion_event, size_t pointer_index);
158 float AMotionEvent_getX(const(AInputEvent)* motion_event, size_t pointer_index);
159 float AMotionEvent_getY(const(AInputEvent)* motion_event, size_t pointer_index);
160 float AMotionEvent_getPressure(const(AInputEvent)* motion_event, size_t pointer_index);
161 float AMotionEvent_getSize(const(AInputEvent)* motion_event, size_t pointer_index);
162 float AMotionEvent_getTouchMajor(const(AInputEvent)* motion_event, size_t pointer_index);
163 float AMotionEvent_getTouchMinor(const(AInputEvent)* motion_event, size_t pointer_index);
164 float AMotionEvent_getToolMajor(const(AInputEvent)* motion_event, size_t pointer_index);
165 float AMotionEvent_getToolMinor(const(AInputEvent)* motion_event, size_t pointer_index);
166 float AMotionEvent_getOrientation(const(AInputEvent)* motion_event, size_t pointer_index);
167 size_t AMotionEvent_getHistorySize(const(AInputEvent)* motion_event);
168 long AMotionEvent_getHistoricalEventTime(const(AInputEvent)* motion_event, size_t history_index);
169 float AMotionEvent_getHistoricalRawX(const(AInputEvent)* motion_event, size_t pointer_index, size_t history_index);
170 float AMotionEvent_getHistoricalRawY(const(AInputEvent)* motion_event, size_t pointer_index, size_t history_index);
171 float AMotionEvent_getHistoricalX(const(AInputEvent)* motion_event, size_t pointer_index, size_t history_index);
172 float AMotionEvent_getHistoricalY(const(AInputEvent)* motion_event, size_t pointer_index, size_t history_index);
173 float AMotionEvent_getHistoricalPressure(const(AInputEvent)* motion_event, size_t pointer_index, size_t history_index);
174 float AMotionEvent_getHistoricalSize(const(AInputEvent)* motion_event, size_t pointer_index, size_t history_index);
175 float AMotionEvent_getHistoricalTouchMajor(const(AInputEvent)* motion_event, size_t pointer_index, size_t history_index);
176 float AMotionEvent_getHistoricalTouchMinor(const(AInputEvent)* motion_event, size_t pointer_index, size_t history_index);
177 float AMotionEvent_getHistoricalToolMajor(const(AInputEvent)* motion_event, size_t pointer_index, size_t history_index);
178 float AMotionEvent_getHistoricalToolMinor(const(AInputEvent)* motion_event, size_t pointer_index, size_t history_index);
179 float AMotionEvent_getHistoricalOrientation(const(AInputEvent)* motion_event, size_t pointer_index, size_t history_index);
180 void AInputQueue_attachLooper(AInputQueue* queue, ALooper* looper, int ident, ALooper_callbackFunc callback, void* data);
181 void AInputQueue_detachLooper(AInputQueue* queue);
182 int AInputQueue_hasEvents(AInputQueue* queue);
183 int AInputQueue_getEvent(AInputQueue* queue, AInputEvent** outEvent);
184 int AInputQueue_preDispatchEvent(AInputQueue* queue, AInputEvent* event);
185 void AInputQueue_finishEvent(AInputQueue* queue, AInputEvent* event, int handled);