Home
last modified time | relevance | path

Searched refs:keyCode (Results 1 – 25 of 271) sorted by relevance

1234567891011

/frameworks/base/core/java/com/android/internal/widget/
DNumericTextView.java245 public boolean onKeyDown(int keyCode, KeyEvent event) { in onKeyDown() argument
246 return isKeyCodeNumeric(keyCode) in onKeyDown()
247 || (keyCode == KeyEvent.KEYCODE_DEL) in onKeyDown()
248 || super.onKeyDown(keyCode, event); in onKeyDown()
252 public boolean onKeyMultiple(int keyCode, int repeatCount, KeyEvent event) { in onKeyMultiple() argument
253 return isKeyCodeNumeric(keyCode) in onKeyMultiple()
254 || (keyCode == KeyEvent.KEYCODE_DEL) in onKeyMultiple()
255 || super.onKeyMultiple(keyCode, repeatCount, event); in onKeyMultiple()
259 public boolean onKeyUp(int keyCode, KeyEvent event) { in onKeyUp() argument
260 return handleKeyUp(keyCode) in onKeyUp()
[all …]
/frameworks/base/services/core/java/com/android/server/policy/
DDeferredKeyActionExecutor.java62 public void queueKeyAction(int keyCode, long downTime, Runnable action) { in queueKeyAction() argument
63 getActionsBufferWithLazyCleanUp(keyCode, downTime).addAction(action); in queueKeyAction()
75 public void setActionsExecutable(int keyCode, long downTime) { in setActionsExecutable() argument
76 getActionsBufferWithLazyCleanUp(keyCode, downTime).setExecutable(); in setActionsExecutable()
84 public void cancelQueuedAction(int keyCode) { in cancelQueuedAction() argument
85 TimedActionsBuffer actionsBuffer = mBuffers.get(keyCode); in cancelQueuedAction()
91 private TimedActionsBuffer getActionsBufferWithLazyCleanUp(int keyCode, long downTime) { in getActionsBufferWithLazyCleanUp() argument
92 TimedActionsBuffer buffer = mBuffers.get(keyCode); in getActionsBufferWithLazyCleanUp()
98 + KeyEvent.keyCodeToString(keyCode)); in getActionsBufferWithLazyCleanUp()
100 buffer = new TimedActionsBuffer(keyCode, downTime); in getActionsBufferWithLazyCleanUp()
[all …]
DSingleKeyGestureDetector.java81 SingleKeyRule(int keyCode) { in SingleKeyRule() argument
82 mKeyCode = keyCode; in SingleKeyRule()
88 private boolean shouldInterceptKey(int keyCode) { in shouldInterceptKey() argument
89 return keyCode == mKeyCode; in shouldInterceptKey()
185 private record MessageObject(SingleKeyRule activeRule, int keyCode, int pressCount, in MessageObject() argument
227 final int keyCode = event.getKeyCode(); in interceptKeyDown() local
229 if (mDownKeyCode == keyCode) { in interceptKeyDown()
233 Log.i(TAG, "Long press key " + KeyEvent.keyCodeToString(keyCode)); in interceptKeyDown()
238 MessageObject object = new MessageObject(mActiveRule, keyCode, /* pressCount= */ 1, in interceptKeyDown()
249 || (mActiveRule != null && !mActiveRule.shouldInterceptKey(keyCode))) { in interceptKeyDown()
[all …]
DKeyCombinationManager.java81 boolean shouldInterceptKey(int keyCode) { in shouldInterceptKey() argument
82 return preCondition() && (keyCode == mKeyCode1 || keyCode == mKeyCode2); in shouldInterceptKey()
159 final int keyCode = event.getKeyCode(); in interceptKeyLocked() local
176 if (mDownTimes.get(keyCode) == 0) { in interceptKeyLocked()
177 mDownTimes.put(keyCode, eventTime); in interceptKeyLocked()
187 if (rule.shouldInterceptKey(keyCode)) { in interceptKeyLocked()
214 mDownTimes.delete(keyCode); in interceptKeyLocked()
217 if (rule.shouldInterceptKey(keyCode)) { in interceptKeyLocked()
229 long getKeyInterceptTimeout(int keyCode) { in getKeyInterceptTimeout() argument
231 if (mDownTimes.get(keyCode) == 0) { in getKeyInterceptTimeout()
[all …]
DGlobalKeyManager.java74 boolean handleGlobalKey(Context context, int keyCode, KeyEvent event) { in handleGlobalKey() argument
76 GlobalKeyAction action = mKeyMapping.get(keyCode); in handleGlobalKey()
94 boolean shouldHandleGlobalKey(int keyCode) { in shouldHandleGlobalKey() argument
95 return mKeyMapping.get(keyCode) != null; in shouldHandleGlobalKey()
101 boolean shouldDispatchFromNonInteractive(int keyCode) { in shouldDispatchFromNonInteractive() argument
102 final GlobalKeyAction action = mKeyMapping.get(keyCode); in shouldDispatchFromNonInteractive()
144 int keyCode = KeyEvent.keyCodeFromString(keyCodeName); in loadGlobalKeys() local
145 if (keyCode != KeyEvent.KEYCODE_UNKNOWN) { in loadGlobalKeys()
146 mKeyMapping.put(keyCode, new GlobalKeyAction( in loadGlobalKeys()
/frameworks/base/core/java/android/view/
DKeyCharacterMap.java302 private static native char nativeGetCharacter(long ptr, int keyCode, int metaState); in nativeGetCharacter() argument
303 private static native boolean nativeGetFallbackAction(long ptr, int keyCode, int metaState, in nativeGetFallbackAction() argument
305 private static native char nativeGetNumber(long ptr, int keyCode); in nativeGetNumber() argument
306 private static native char nativeGetMatch(long ptr, int keyCode, char[] chars, int metaState); in nativeGetMatch() argument
307 private static native char nativeGetDisplayLabel(long ptr, int keyCode); in nativeGetDisplayLabel() argument
403 int keyCode = nativeGetMappedKey(mPtr, scanCode); in getMappedKeyOrDefault() local
404 return keyCode == KeyEvent.KEYCODE_UNKNOWN ? defaultKeyCode : keyCode; in getMappedKeyOrDefault()
428 public int get(int keyCode, int metaState) { in get() argument
430 char ch = nativeGetCharacter(mPtr, keyCode, metaState); in get()
457 public FallbackAction getFallbackAction(int keyCode, int metaState) { in getFallbackAction() argument
[all …]
/frameworks/base/core/java/android/text/method/
DMetaKeyKeyListener.java326 public boolean onKeyDown(View view, Editable content, int keyCode, KeyEvent event) { in onKeyDown() argument
327 if (keyCode == KeyEvent.KEYCODE_SHIFT_LEFT || keyCode == KeyEvent.KEYCODE_SHIFT_RIGHT) { in onKeyDown()
332 if (keyCode == KeyEvent.KEYCODE_ALT_LEFT || keyCode == KeyEvent.KEYCODE_ALT_RIGHT in onKeyDown()
333 || keyCode == KeyEvent.KEYCODE_NUM) { in onKeyDown()
338 if (keyCode == KeyEvent.KEYCODE_SYM) { in onKeyDown()
383 public boolean onKeyUp(View view, Editable content, int keyCode, KeyEvent event) { in onKeyUp() argument
384 if (keyCode == KeyEvent.KEYCODE_SHIFT_LEFT || keyCode == KeyEvent.KEYCODE_SHIFT_RIGHT) { in onKeyUp()
389 if (keyCode == KeyEvent.KEYCODE_ALT_LEFT || keyCode == KeyEvent.KEYCODE_ALT_RIGHT in onKeyUp()
390 || keyCode == KeyEvent.KEYCODE_NUM) { in onKeyUp()
395 if (keyCode == KeyEvent.KEYCODE_SYM) { in onKeyUp()
[all …]
/frameworks/native/services/inputflinger/rust/
Dsticky_keys_filter.rs79 if !is_ephemeral_modifier_key(event.keyCode) { in notify_key()
90 if up && !is_modifier_key(event.keyCode) { in notify_key()
98 let modifier_key_mask = get_ephemeral_modifier_key_mask(event.keyCode); in notify_key()
99 let symmetrical_modifier_key_mask = get_symmetrical_modifier_key_mask(event.keyCode); in notify_key()
254 keyCode: 0,
280 sticky_keys_filter.notify_key(&KeyEvent { keyCode: *key_code, ..BASE_KEY_DOWN }); in test_notify_key_consumes_ephemeral_modifier_keys()
283 sticky_keys_filter.notify_key(&KeyEvent { keyCode: *key_code, ..BASE_KEY_UP }); in test_notify_key_consumes_ephemeral_modifier_keys()
304 let event = KeyEvent { keyCode: *key_code, ..BASE_KEY_DOWN }; in test_notify_key_passes_non_ephemeral_modifier_keys()
307 let event = KeyEvent { keyCode: *key_code, ..BASE_KEY_UP }; in test_notify_key_passes_non_ephemeral_modifier_keys()
321 let event = KeyEvent { keyCode: KEY_A, ..BASE_KEY_DOWN }; in test_notify_key_passes_non_modifier_keys()
[all …]
/frameworks/base/core/java/android/widget/
DDialerFilter.java110 public boolean onKeyDown(int keyCode, KeyEvent event) { in onKeyDown() argument
113 switch (keyCode) { in onKeyDown()
125 handled = mDigits.onKeyDown(keyCode, event); in onKeyDown()
126 handled &= mLetters.onKeyDown(keyCode, event); in onKeyDown()
130 handled = mLetters.onKeyDown(keyCode, event); in onKeyDown()
138 mLetters.onKeyDown(keyCode, event); in onKeyDown()
141 handled = mDigits.onKeyDown(keyCode, event); in onKeyDown()
145 handled = mDigits.onKeyDown(keyCode, event); in onKeyDown()
149 handled = mLetters.onKeyDown(keyCode, event); in onKeyDown()
159 handled = mLetters.onKeyDown(keyCode, event); in onKeyDown()
[all …]
/frameworks/native/services/inputflinger/reader/mapper/
DKeyboardInputMapper.cpp31 static int32_t rotateKeyCode(int32_t keyCode, ui::Rotation orientation) { in rotateKeyCode() argument
51 if (rotation[static_cast<size_t>(ui::ROTATION_0)] == keyCode) { in rotateKeyCode()
56 return keyCode; in rotateKeyCode()
66 static bool isMediaKey(int32_t keyCode) { in isMediaKey() argument
67 switch (keyCode) { in isMediaKey()
259 int32_t keyCode; in processKey() local
264 if (getDeviceContext().mapKey(scanCode, usageCode, mMetaState, &keyCode, &keyMetaState, in processKey()
266 keyCode = AKEYCODE_UNKNOWN; in processKey()
276 keyCode = rotateKeyCode(keyCode, getOrientation()); in processKey()
282 keyCode = mKeyDowns[*keyDownIndex].keyCode; in processKey()
[all …]
/frameworks/base/packages/SystemUI/src/com/android/systemui/qs/
DLeftRightArrowPressedListener.kt40 override fun onKey(view: View, keyCode: Int, keyEvent: KeyEvent): Boolean { in onKey()
41 if (keyCode == KeyEvent.KEYCODE_DPAD_LEFT || keyCode == KeyEvent.KEYCODE_DPAD_RIGHT) { in onKey()
45 if (keyEvent.action == KeyEvent.ACTION_UP && keyCode == lastKeyCode) { in onKey()
46 listener?.accept(keyCode) in onKey()
52 lastKeyCode = keyCode in onKey()
/frameworks/native/libs/input/
DKeyCharacterMap.cpp173 for (const auto& [keyCode, key] : overlay.mKeys) { in combine()
174 mKeys.insert_or_assign(keyCode, key); in combine()
202 char16_t KeyCharacterMap::getDisplayLabel(int32_t keyCode) const { in getDisplayLabel()
204 const Key* key = getKey(keyCode); in getDisplayLabel()
209 ALOGD("getDisplayLabel: keyCode=%d ~ Result %d.", keyCode, result); in getDisplayLabel()
214 char16_t KeyCharacterMap::getNumber(int32_t keyCode) const { in getNumber()
216 const Key* key = getKey(keyCode); in getNumber()
221 ALOGD("getNumber: keyCode=%d ~ Result %d.", keyCode, result); in getNumber()
226 char16_t KeyCharacterMap::getCharacter(int32_t keyCode, int32_t metaState) const { in getCharacter() argument
228 const Behavior* behavior = getKeyBehavior(keyCode, metaState); in getCharacter()
[all …]
/frameworks/base/packages/PackageInstaller/src/com/android/packageinstaller/
DAlertActivity.java92 public boolean onKeyDown(int keyCode, KeyEvent event) { in onKeyDown() argument
93 if (mAlert.onKeyDown(keyCode, event)) return true; in onKeyDown()
94 return super.onKeyDown(keyCode, event); in onKeyDown()
98 public boolean onKeyUp(int keyCode, KeyEvent event) { in onKeyUp() argument
99 if (mAlert.onKeyUp(keyCode, event)) return true; in onKeyUp()
100 return super.onKeyUp(keyCode, event); in onKeyUp()
/frameworks/native/include/input/
DKeyCharacterMap.h70 int32_t keyCode; member
96 char16_t getDisplayLabel(int32_t keyCode) const;
102 char16_t getNumber(int32_t keyCode) const;
107 char16_t getCharacter(int32_t keyCode, int32_t metaState) const;
113 bool getFallbackAction(int32_t keyCode, int32_t metaState,
120 char16_t getMatch(int32_t keyCode, const char16_t* chars,
142 std::pair<int32_t /*keyCode*/, int32_t /*metaState*/> applyKeyBehavior(int32_t keyCode,
238 const Key* getKey(int32_t keyCode) const;
239 const Behavior* getKeyBehavior(int32_t keyCode, int32_t metaState) const;
245 int32_t deviceId, int32_t keyCode, int32_t metaState, bool down, nsecs_t time);
[all …]
/frameworks/base/packages/SystemUI/tests/src/com/android/systemui/qs/
DLeftRightArrowPressedListenerTest.kt40 override fun accept(keyCode: Int) { in accept()
41 lastValue = keyCode in accept()
88 private fun LeftRightArrowPressedListener.sendKey(action: Int, keyCode: Int) { in sendKey()
89 onKey(view, keyCode, KeyEvent(action, keyCode)) in sendKey()
94 keyCode: Int, in sendKeyWithRepeat()
105 onKey(view, keyCode, keyEvent) in sendKeyWithRepeat()
/frameworks/base/core/java/android/service/voice/
DVoiceInteractionWindow.java192 public boolean onKeyDown(int keyCode, KeyEvent event) { in onKeyDown() argument
193 if (mKeyEventCallback != null && mKeyEventCallback.onKeyDown(keyCode, event)) { in onKeyDown()
196 return super.onKeyDown(keyCode, event); in onKeyDown()
200 public boolean onKeyLongPress(int keyCode, KeyEvent event) { in onKeyLongPress() argument
201 if (mKeyEventCallback != null && mKeyEventCallback.onKeyLongPress(keyCode, event)) { in onKeyLongPress()
204 return super.onKeyLongPress(keyCode, event); in onKeyLongPress()
208 public boolean onKeyUp(int keyCode, KeyEvent event) { in onKeyUp() argument
209 if (mKeyEventCallback != null && mKeyEventCallback.onKeyUp(keyCode, event)) { in onKeyUp()
212 return super.onKeyUp(keyCode, event); in onKeyUp()
216 public boolean onKeyMultiple(int keyCode, int count, KeyEvent event) { in onKeyMultiple() argument
[all …]
/frameworks/base/core/java/com/android/internal/app/
DAlertActivity.java106 public boolean onKeyDown(int keyCode, KeyEvent event) { in onKeyDown() argument
107 if (mAlert.onKeyDown(keyCode, event)) return true; in onKeyDown()
108 return super.onKeyDown(keyCode, event); in onKeyDown()
112 public boolean onKeyUp(int keyCode, KeyEvent event) { in onKeyUp() argument
113 if (mAlert.onKeyUp(keyCode, event)) return true; in onKeyUp()
114 return super.onKeyUp(keyCode, event); in onKeyUp()
/frameworks/base/services/core/java/com/android/server/tv/
DUinputBridge.java37 private static native void nativeSendKey(long ptr, int keyCode, boolean down); in nativeSendKey() argument
50 private static native void nativeSendGamepadKey(long ptr, int keyCode, boolean down); in nativeSendGamepadKey() argument
138 public void sendKeyDown(IBinder token, int keyCode) { in sendKeyDown() argument
140 nativeSendKey(mPtr, keyCode, true /*down*/); in sendKeyDown()
144 public void sendKeyUp(IBinder token, int keyCode) { in sendKeyUp() argument
146 nativeSendKey(mPtr, keyCode, false /*down*/); in sendKeyUp()
172 public void sendGamepadKey(IBinder token, int keyCode, boolean down) { in sendGamepadKey() argument
174 nativeSendGamepadKey(mPtr, keyCode, down); in sendGamepadKey()
/frameworks/base/core/java/com/android/internal/globalactions/
DActionsDialog.java80 public boolean onKeyDown(int keyCode, KeyEvent event) { in onKeyDown() argument
81 if (mAlert.onKeyDown(keyCode, event)) { in onKeyDown()
84 return super.onKeyDown(keyCode, event); in onKeyDown()
88 public boolean onKeyUp(int keyCode, KeyEvent event) { in onKeyUp() argument
89 if (mAlert.onKeyUp(keyCode, event)) { in onKeyUp()
92 return super.onKeyUp(keyCode, event); in onKeyUp()
/frameworks/base/services/tests/wmtests/src/com/android/server/policy/
DShortcutKeyTestBase.java147 final int keyCode = keyCodes[i]; in sendKeyCombination() local
148 final KeyEvent event = new KeyEvent(downTime, downTime, KeyEvent.ACTION_DOWN, keyCode, in sendKeyCombination()
154 metaState |= MODIFIER.getOrDefault(keyCode, 0); in sendKeyCombination()
164 final int keyCode = keyCodes[i]; in sendKeyCombination() local
166 KeyEvent.ACTION_DOWN, keyCode, 1 /*repeat*/, metaState, in sendKeyCombination()
176 final int keyCode = keyCodes[i]; in sendKeyCombination() local
177 final KeyEvent upEvent = new KeyEvent(downTime, eventTime, KeyEvent.ACTION_UP, keyCode, in sendKeyCombination()
182 metaState &= ~MODIFIER.getOrDefault(keyCode, 0); in sendKeyCombination()
199 void sendKey(int keyCode) { in sendKey() argument
200 sendKey(keyCode, false); in sendKey()
[all …]
/frameworks/base/packages/SystemUI/src/com/android/keyguard/
DKeyguardPinBasedInputView.java96 public boolean onKeyDown(int keyCode, KeyEvent event) { in onKeyDown() argument
97 if (keyCode == KeyEvent.KEYCODE_DEL) { in onKeyDown()
101 if (keyCode >= KeyEvent.KEYCODE_0 && keyCode <= KeyEvent.KEYCODE_9) { in onKeyDown()
102 int number = keyCode - KeyEvent.KEYCODE_0; in onKeyDown()
106 if (keyCode >= KeyEvent.KEYCODE_NUMPAD_0 && keyCode <= KeyEvent.KEYCODE_NUMPAD_9) { in onKeyDown()
107 int number = keyCode - KeyEvent.KEYCODE_NUMPAD_0; in onKeyDown()
111 return super.onKeyDown(keyCode, event); in onKeyDown()
115 public boolean onKeyUp(int keyCode, KeyEvent event) { in onKeyUp() argument
116 if (KeyEvent.isConfirmKey(keyCode)) { in onKeyUp()
120 return super.onKeyUp(keyCode, event); in onKeyUp()
/frameworks/base/core/jni/
Dandroid_view_KeyCharacterMap.cpp44 jfieldID keyCode; member
130 jint keyCode, jint metaState) { in nativeGetCharacter() argument
135 return map->getMap()->getCharacter(keyCode, metaState); in nativeGetCharacter()
138 static jboolean nativeGetFallbackAction(JNIEnv *env, jobject clazz, jlong ptr, jint keyCode, in nativeGetFallbackAction() argument
146 bool result = map->getMap()->getFallbackAction(keyCode, metaState, &fallbackAction); in nativeGetFallbackAction()
148 env->SetIntField(fallbackActionObj, gFallbackActionClassInfo.keyCode, in nativeGetFallbackAction()
149 fallbackAction.keyCode); in nativeGetFallbackAction()
157 static jchar nativeGetNumber(JNIEnv *env, jobject clazz, jlong ptr, jint keyCode) { in nativeGetNumber() argument
162 return map->getMap()->getNumber(keyCode); in nativeGetNumber()
166 static jchar nativeGetMatch(JNIEnv *env, jobject clazz, jlong ptr, jint keyCode, in nativeGetMatch() argument
[all …]
/frameworks/base/services/tests/InputMethodSystemServerTests/test-apps/SimpleTestIme/src/com/android/apps/inputmethod/simpleime/
DSimpleInputMethodService.java54 Integer keyCode = KeyCodeConstants.KEY_NAME_TO_CODE_MAP.get(data); in handle() local
55 Log.v(TAG, "keyCode: " + keyCode); in handle()
56 if (keyCode != null) { in handle()
62 keyCode, in handle()
64 KeyCodeConstants.isAlphaKeyCode(keyCode) ? keyboardState : 0)); in handle()
/frameworks/base/media/java/android/media/tv/
DITvRemoteServiceInput.aidl33 void sendKeyDown(IBinder token, int keyCode); in sendKeyDown() argument
35 void sendKeyUp(IBinder token, int keyCode); in sendKeyUp() argument
45 void sendGamepadKeyDown(IBinder token, int keyCode); in sendGamepadKeyDown() argument
46 void sendGamepadKeyUp(IBinder token, int keyCode); in sendGamepadKeyUp() argument
/frameworks/native/services/inputflinger/tests/
DKeyboardInputMapper_test.cpp79 for (int32_t keyCode : keyCodes) { in testTouchpadTapStateForKeys() local
80 process(EV_KEY, keyCode, 1); in testTouchpadTapStateForKeys()
82 process(EV_KEY, keyCode, 0); in testTouchpadTapStateForKeys()
120 for (int32_t keyCode : keyCodes) { in TEST_F() local
121 process(when, EV_KEY, keyCode, 1); in TEST_F()
123 process(when, EV_KEY, keyCode, 0); in TEST_F()

1234567891011