Chatterino2: Custom hotkeys

Created on 6 Mar 2020  路  8Comments  路  Source: Chatterino/chatterino2

Is your feature request related to a problem? Please describe.

Unwanted hotkeys can be a problem see #1515.

Describe the solution you'd like

I would like for the client to have a list of shortcuts, if none is found the default shortcuts are filled in. Hotkeys would be categorized by scope (this decides where the shortcut is registered and where it works). Each shortcut would need to contain the scope, key_sequence and action. These would be stored in a list in the settings.json file. All widgets would have to have a list of defined actions, for example for a split that could be:

  • change_channel
  • close
  • open_popup
  • open_search
  • etc.

Describe alternatives you've considered

Not doing it and sticking to hard-coded shortcuts.

Additional context

Example hotkey:

{
  "scope": "split",
  "key_sequence": "Ctrl+L",
  "action": "clear"
}

I'm posting this because I didn't find the feature request, sorry if there is one for this already

Possible implementation

  1. Create a new controller for keybinds. That would store the currently registered actions and the scopes they belong in.

    1. Create a Action struct that would hold information about a particular keybind: the scope of it, the action name, the function connected to it and possibly the default key combo (this could be put in a separate file to make changing default hotkeys easier, but it would make adding new ones harder)

    2. The controller should save actions with the functions they are connected to.

  2. Find every single keybind in the program. Note: My list is probably incomplete
  3. Replace with appropriate calls to the controller.
enhancement major-feature

Most helpful comment

also: keybinding to clear messages

All 8 comments

Here is a list of shortcuts' definitions: https://gist.github.com/Mm2PL/bffc294068248c94001e69b9c538e48e

A couple of non-obvious actions:

  • split_input.undo
  • split_input.redo
  • split_input.copy
  • split_input.paste
  • split_input.delete Deletes the selection
  • split_input.select_all
  • split_input.clear Clears the input box

Actions could also be triggered by commands and such.

I would like to add arguments to this proposal. Action arguments could be a list of strings that tell the actions the specifics of what to do.
Example:

{
  "scope": "tab",
  "key_sequence": "Alt+H",
  "action": "focus",
  "arguments": [
    "left"
  ]
}

Hey, got curious and started looking at custom keybinds: i'd like to be able to open the current tab in streamlink, either with a "keybind", or, sending a message in that chat (obviously the message would be totally truncated - was thinking more along the lines of a chatterino command?)

Regardless i'd like to see this feature, and I could even offer help, i've had a look at the source to see if i can fudge a simple solution for what i want but, i got hungry and gave up...

ch2shortcuts2020-09-01_14-43
:)

also: keybinding to clear messages

also: open viewer list

Was this page helpful?
0 / 5 - 0 ratings

Related issues

nitrousGranola picture nitrousGranola  路  3Comments

TranRed picture TranRed  路  3Comments

DatGuy1 picture DatGuy1  路  3Comments

TETYYS picture TETYYS  路  3Comments

doximanman picture doximanman  路  3Comments