cfdf515228
- .claude/CLAUDE.md - .claude/commands/subagentes.md - .claude/rules/INDEX.md - .mcp.json - bash/functions/cybersecurity/analyze_dns.md - bash/functions/cybersecurity/audit_http_headers.md - bash/functions/cybersecurity/audit_ssh_config.md - bash/functions/cybersecurity/check_firewall.md - bash/functions/cybersecurity/detect_suspicious_users.md - bash/functions/cybersecurity/encrypt_file.md - ... Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2.2 KiB
2.2 KiB
name, kind, lang, domain, version, purity, signature, description, tags, params, output, uses_functions, uses_types, returns, returns_optional, error_type, imports, tested, tests, test_file_path, file_path, notes
| name | kind | lang | domain | version | purity | signature | description | tags | params | output | uses_functions | uses_types | returns | returns_optional | error_type | imports | tested | tests | test_file_path | file_path | notes | |||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| android_input_keyevent | function | bash | infra | 1.0.0 | impure | android_input_keyevent([--serial <S>] key: string) | Send key event via adb shell input keyevent. Accepts aliases (BACK, HOME, POWER, ENTER, MENU, RECENT_APPS, VOLUME_UP, VOLUME_DOWN), raw numeric codes, or explicit KEYCODE_* names. |
|
|
Stdout 'key: <code> on <serial>'. |
|
false | error_go_core | false | bash/functions/infra/android_input_keyevent.sh | Lista completa de keycodes: https://developer.android.com/reference/android/view/KeyEvent. Exit 3 si adb_pick_serial falla (ningun device o ambiguo sin --serial). |
Ejemplo
# Pulsar BACK en el unico device conectado
android_input_keyevent BACK
# Pulsar HOME en un emulador especifico
android_input_keyevent --serial emulator-5554 HOME
# Codigo numerico directo
android_input_keyevent 26 # POWER
# KEYCODE_* explicito
android_input_keyevent KEYCODE_DPAD_CENTER
Notas
Aliases resueltos internamente:
| Alias | KEYCODE |
|---|---|
| BACK | KEYCODE_BACK |
| HOME | KEYCODE_HOME |
| POWER | KEYCODE_POWER |
| ENTER | KEYCODE_ENTER |
| MENU | KEYCODE_MENU |
| RECENT_APPS | KEYCODE_APP_SWITCH |
| VOLUME_UP | KEYCODE_VOLUME_UP |
| VOLUME_DOWN | KEYCODE_VOLUME_DOWN |
Si el argumento no coincide con ningun alias y no es numerico, se construye KEYCODE_<UPPER> para pasarlo directo a adb shell input keyevent.
Exit codes: 1 = keycode vacio, 3 = fallo de adb_pick_serial (ningun device o ambiguo).