Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: extra-keys configuration fails to parse backslash (\) character in termux.properties #4386

Open
5igm opened this issue Feb 5, 2025 · 1 comment

Comments

@5igm
Copy link

5igm commented Feb 5, 2025

Problem description

Description:
When configuring extra-keys in ~/.termux/termux.properties, the backslash (\) character cannot be displayed or parsed correctly. Here are the details:


Proposed Solutions:

  1. Fix the parsing logic for backslashes in extra-keys.
  2. Update the documentation to clarify how to use special characters like \.
  3. Support JSON format for extra-keys configuration.

Additional Notes:
This issue prevents users from using the backslash character in custom keyboard layouts, which is essential for many programming tasks. Any guidance or fix would be greatly appreciated!

Steps to reproduce the behavior.

  1. Actual Behavior:

    • If I use '\', the backslash does not appear on the keyboard.
    • If I use '\\', Termux throws an error:
      Could not load and set the "extra-keys" property from the properties file: org.js…
      
    • If I use Unicode '\u005c', the same error occurs.
    • If I use JSON format (e.g., {"extra-keys": [["ESC","\\\\","|","[","UP","]","PGUP"]]}), the configuration is not recognized.
  2. Steps to Reproduce:

    • Edit ~/.termux/termux.properties:
      extra-keys = [['ESC','\\','|','[','UP',']','PGUP'], ['TAB','CTRL','ALT','LEFT','DOWN','RIGHT','PGDN']]
    • Run termux-reload-settings.
    • Observe the error or missing backslash on the keyboard.

What is the expected behavior?

  1. Expected Behavior:
    The backslash (\) character should be displayed on the Termux virtual keyboard when configured in extra-keys.

System information

  1. Additional Information:
    • Termux Version: (Run termux-info to get this information)
      Application version:
      0.118.0
      Packages CPU architecture:
      aarch64
      Subscribed repositories:
      # sources.list
      ...
    • Device: (e.g., Samsung Galaxy S21, Android 12)
    • Configuration File:
      # ~/.termux/termux.properties
      extra-keys = [['ESC','\\','|','[','UP',']','PGUP'], ['TAB','CTRL','ALT','LEFT','DOWN','RIGHT','PGDN']]
@5igm 5igm added the bug report label Feb 5, 2025
@sylirre
Copy link
Member

sylirre commented Feb 6, 2025

Use keyword BACKSLASH instead of actual character

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants