这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@neverwin
Copy link
Contributor

@neverwin neverwin commented Apr 6, 2018

People can change extra keys to meet their needs. For example, add one line in termux.properties:

extrakeys = [["ESC","CTRL","ALT","TAB","―","/","|"]]

That's the default one of Termux.

@robertvandeneynde
Copy link
Contributor

robertvandeneynde commented Apr 30, 2018

Merged with PR #605 that would be a great way to make the overlay customisable !

As long as the name of control keys are obvious and ascii, like LEFT, TAB, "-" etc.

Or Unicode if the user wants to add "é" or greek letters or whatever he wants.

@robertvandeneynde
Copy link
Contributor

And the strings don't have to be of length 1, one could add keywords like if or lambda or if(){}.

@fornwall
Copy link
Member

@robertvandeneynde Sorry for the delay here! Now that #605 has been merged, could you look at rebasing your changes on top of that?

@rubikitch
Copy link

I'm WAITING FOR merging this PR!!

@robertvandeneynde
Copy link
Contributor

@fornwall, that's not my PR ! However I think I have a good view of how a good customisation would be (as me and others talked on another PR and issue) but I don't know how to have a local build in order to code the change myself.

@daemondev
Copy link

Waiting for this merge, because I do not want to downgrade to version 0.61

@ghost ghost mentioned this pull request Jul 8, 2018
@robertvandeneynde
Copy link
Contributor

robertvandeneynde commented Jul 14, 2018

@neverwin could you rebase your changes now that #605 has been merged ?
Also, is the termux.properties file documented somewhere ?

About the choice of syntax, we have
extrakeys = [["ESC","CTRL","ALT","TAB","―","/","|"]]

extrakeys must therefore be an list of list, what happens if is is not ? @fornwall

I suggest at least those options (and documented somewhere on the wiki) :

  • If extrakeys = ["A", "B", "C"], it means [["A", "B", "C"]], formally, extrakeys is either a list of list, either a list of strings, in the latter case, it is converted to a list of size 1 containing the initial list.
  • The items can be strings or a json object. "TAB" is a shortcut for {"key": "TAB"}. Several options could then be added in future versions, like {"key": "TAB", "display": "↹"} or {"key": "TAB", "display": "\u21B9"}.
  • "key" means the key to emit, like "TAB" or "/" or any unicode string like "if (" or "été", some special keywords like TAB exist to supply special control characters, if one wants to write exactly the three letters "TAB" in one stroke, it is not possible.
  • "display" means the character displayed on the interface, if not provided, it defaults to "key".

I think this should be implemented in this PR.

More ideas for future enhancement/PR include :

  • "weight", would change the layout, defaults to 1. if there is a row like {"key":"A", "weigth":1}, {"key":"SPACE", display:"␣", "weigth": 3}, {"key":"C", "weigth": 1} it means the A takes 1/5 of the width, the SPACE takes 3/5, the C takes 1/5 of the width.
  • "longpress", currently add some func keys #605 added "|" on the "-" key and it is impossible to guess, in the config it could be written as {"key":"-", "display":"\u2013", "longpress": {"key": "|"}}. A "longpress" key cannot contain a "longpress" attribute. "longpress" can be a list of keys instead of a string or object. Personnaly, I think having longpress keys is not very productive.

I could code it myseslf and create my own PR if I knew how to build the app.

@Grimler91
Copy link
Member

Closing, since #788 incorporated these changes

@Grimler91 Grimler91 closed this Oct 10, 2018
@neverwin
Copy link
Contributor Author

Sorry for the late reply due to some personal difficulties. Thanks for your efforts about this function 👍.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants