Skip to content

Intent keys -20000/-20001/-20002 #2396

@dioput12

Description

@dioput12
## Describe the Bug

**Intent key codes** `SEND_INTENT_ONE` (-20000), `SEND_INTENT_TWO` (-20001), and `SEND_INTENT_THREE` (-20002) **always fail JSON parsing** with "Too long text on key" error, even with minimal configurations. This appears to be a **preview validation bug** blocking all intent functionality.

## Steps to Reproduce

1. Create minimal intent key JSON:
```json
[{"label":"Test","code":-20000,"intent":{"action":"android.intent.action.VIEW"}}]
  1. Import via Settings → Languages & Layouts → Edit layout → Load file

  2. Result: Too long text on key: android.intent.ac... (truncated toast)

Additional Failing Examples

Option 1: Minimal intent (no extras)
{"label":"T","code":-20000,"intent":{"action":"com.termux.RUN_COMMAND","package":"com.termux"}}
→ FAIL: "Too long text on key: com.termux.RUN_COMMAN"

Option 2: codePoints bypass attempt
{"label":"T","type":"multi_text_key","codePoints":} [reddit](https://www.reddit.com/r/fossdroid/comments/1e81fvp/what_is_an_open_source_android_app_idea_that/)
→ FAIL: JSON parsing error

Option 3: Label format (like working 💻|!code/-1 popup)
{"label":"T|login"}
→ FAIL: Parser rejects pipe format on main keys

Expected Behavior

Intent keys should:

  1. Parse valid JSON layouts containing code: -20000/-20001/-20002
  2. Execute Android Intent broadcasts on tap (FlorisBoard heritage)
  3. Support extras for Termux: com.termux.RUN_COMMAND

Current Behavior

All intent configurations rejected at parse time by preview validation toast. Text insertion (label|text) works but cannot execute shell commands directly.

Environment

  • HeliBoard Version: 3.8 stable, tested beta/nouserlib/debug
  • Android Version: 16
  • Layout Type: Custom QWERTY main layout (row 1, position 5)

Minimal Reproduction File

test_intent.json (attach this file):

[
  {"label": "q"},
  {"label": "w"},
  {"label": "e"},
  {"label": "r"},
  {"label": "T","code":-20000,"intent":{"action":"android.intent.action.VIEW"}},
  {"label": "y"},
  {"label": "u"},
  {"label": "i"},
  {"label": "o"},
  {"label": "p"}
]

Additional Context

  1. Working baseline: Complex popups like 💻|!code/-1 function perfectly
  2. Intent heritage: Codes exist in KeyCode.kt but appear non-functional
  3. Workaround: Manual text insertion → Termux Enter (not direct execution)
  4. Previous attempts: 20+ JSON variants, all fail at preview validation

This blocks Termux automation workflows requiring direct shell command execution from keyboard. Request: either fix intent parsing or document as unsupported.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions