Lines Matching defs:inputSource

70         int inputSource = InputDevice.SOURCE_UNKNOWN;
72 inputSource = SOURCES.get(command);
81 inputSource = getSource(inputSource, InputDevice.SOURCE_KEYBOARD);
82 sendText(inputSource, args[index+1]);
89 inputSource = getSource(inputSource, InputDevice.SOURCE_KEYBOARD);
96 sendKeyEvent(inputSource, keyCode, longpress);
103 inputSource = getSource(inputSource, InputDevice.SOURCE_TOUCHSCREEN);
104 sendTap(inputSource, Float.parseFloat(args[index+1]),
110 inputSource = getSource(inputSource, InputDevice.SOURCE_TOUCHSCREEN);
115 sendSwipe(inputSource,
122 inputSource = getSource(inputSource, InputDevice.SOURCE_TRACKBALL);
124 sendTap(inputSource, 0.0f, 0.0f);
128 inputSource = getSource(inputSource, InputDevice.SOURCE_TRACKBALL);
130 sendMove(inputSource, Float.parseFloat(args[index+1]),
182 private void sendKeyEvent(int inputSource, int keyCode, boolean longpress) {
185 KeyCharacterMap.VIRTUAL_KEYBOARD, 0, 0, inputSource));
189 inputSource));
192 KeyCharacterMap.VIRTUAL_KEYBOARD, 0, 0, inputSource));
195 private void sendTap(int inputSource, float x, float y) {
197 injectMotionEvent(inputSource, MotionEvent.ACTION_DOWN, now, x, y, 1.0f);
198 injectMotionEvent(inputSource, MotionEvent.ACTION_UP, now, x, y, 0.0f);
201 private void sendSwipe(int inputSource, float x1, float y1, float x2, float y2, int duration) {
206 injectMotionEvent(inputSource, MotionEvent.ACTION_DOWN, now, x1, y1, 1.0f);
212 injectMotionEvent(inputSource, MotionEvent.ACTION_MOVE, now, lerp(x1, x2, alpha),
216 injectMotionEvent(inputSource, MotionEvent.ACTION_UP, now, x2, y2, 0.0f);
222 * @param inputSource the InputDevice.SOURCE_* sending the input event
226 private void sendMove(int inputSource, float dx, float dy) {
228 injectMotionEvent(inputSource, MotionEvent.ACTION_MOVE, now, dx, dy, 0.0f);
237 private int getInputDeviceId(int inputSource) {
242 if (inputDev.supportsSource(inputSource)) {
252 * @param inputSource the InputDevice.SOURCE_* sending the input event
259 private void injectMotionEvent(int inputSource, int action, long when, float x, float y, float pressure) {
267 getInputDeviceId(inputSource), DEFAULT_EDGE_FLAGS);
268 event.setSource(inputSource);
278 private static final int getSource(int inputSource, int defaultSource) {
279 return inputSource == InputDevice.SOURCE_UNKNOWN ? defaultSource : inputSource;