gomuks icon indicating copy to clipboard operation
gomuks copied to clipboard

Add customizable keyboard shortcuts.

Open roket1428 opened this issue 4 years ago • 9 comments

roket1428 avatar Mar 03 '20 14:03 roket1428

I agree! For a terminal program to fit in the community, customizable keys are very important. Allowing custom keys is a sign that the program cares about power users. For example, I want a custom key that uploads the file ~/s.png (my last screenshot), and a bunch of custom keys for jumping to very specific Matrix rooms, so I don't need to search for them each time.

MRAAGH avatar Apr 02 '20 10:04 MRAAGH

I agree! For a terminal program to fit in the community, customizable keys are very important. Allowing custom keys is a sign that the program cares about power users. For example, I want a custom key that uploads the file ~/s.png (my last screenshot), and a bunch of custom keys for jumping to very specific Matrix rooms, so I don't need to search for them each time.

I generally don't want to use arrow keys and as a non-qwerty user, it is hard to use "normal" shortcuts. :) On the other hand, having customizable keys is just a requirement for generally everything. Like one like their soup salty other one doesn't. It is a matter of taste, you get the idea. ^. ^

roket1428 avatar Apr 02 '20 10:04 roket1428

ooh, I'd like to add, parsing keybindings out of the configuration file is totally enough, we don't necessarily need commands inside gomuks for changing the configuration. A lot of other programs also expect us to edit the config files manually.

MRAAGH avatar Apr 02 '20 10:04 MRAAGH

ooh, I'd like to add, parsing keybindings out of the configuration file is totally enough, we don't necessarily need commands inside gomuks for changing the configuration. A lot of other programs also expect us to edit the config files manually.

Agreed.

roket1428 avatar Apr 02 '20 12:04 roket1428

Should we create a list of features that we want to be accessible with custom keybindings? Maybe in the form of a wiki page?

MRAAGH avatar Apr 09 '20 15:04 MRAAGH

Any ideas on how this is supposed to be implemented? I just did something like this in go for my whatscli app - if theres any outline already I can take a whack..?

normen avatar Dec 02 '20 20:12 normen

@normen I would do it like this: when opening the program, a configuration file is read and formed into such a data structure that can be used for interpreting keypresses. The file would have a syntax of one entry per line, maybe like this:

key.ctrl-uparrow = rooms.prev

I have no experience with go; but one way this would be possible, is if you have function references (or equivalent) indexed by key identifiers. The tricky part here might be generalizing all the functionalities so that they have compatible interfaces. Of course, then, this needs to become the new code taking care of keyboard input. Lastly, you would need to make a default configuration that matches the existing functionality of gomuks.

Bonus points if you make it possible to map sequences of keypresses like in Weechat and some other software, for example like this:

key.ctrl-G+key.ctrl-O = rooms.jump("id_of_some_specific_room")

Allowing such sequences greatly increases the number of available bindings, and jumping to specific rooms is an example of something I'd use this for.

MRAAGH avatar Dec 04 '20 15:12 MRAAGH

Sorry, I meant more specific plans :) Something like that yeah, thats similar to what I did in my app. But thats exactly what I am asking, where and how this would plug in to gomuks.

normen avatar Dec 04 '20 15:12 normen

Ah. I think we will need @tulir for that

MRAAGH avatar Dec 04 '20 21:12 MRAAGH