telegramdesktop / tdesktop

Telegram Desktop messaging app
https://desktop.telegram.org/
Other
26.42k stars 5.25k forks source link

[Feature] Add keyboard shortcuts for controlling media playback #28579

Open egoarka opened 1 month ago

egoarka commented 1 month ago

Is your feature request related to a problem?

Add ability to control media playback with shortcuts.

Describe the solution you'd like

Mod + n - next track Mod + p - prev track Mod + c - pause Mod + s - reverse order / shuffle Mod + r - repeat Mod + -/+ - control volume Mod + </> - control playback speed Mod + Shift + Left Arrow key - rewind by 10 seconds Mod + Shift + Right Arrow key - fast forward by 10 seconds Mod + x - close media

Where Mod might be Ctrl or Alt key

Describe alternatives you've considered

automate by clicking on media controls by locating them on screen with automating tools

Additional context

No response

ilya-fedin commented 1 month ago

First three shortcuts already exist but with different keys

egoarka commented 1 month ago

Thanks. could not find info about it anywhere, found myself by randomly typing fn keys, so in case someone is looking for them: F5 - prev track F6 - pause F7 - next track


In case someone wants to remap them easily with xremap on linux, here is a config.

keymap:
  - name: Telegram binding
    application:
      only: [TelegramDesktop]
    remap:
      C-p: KEY_PREVIOUSSONG
      C-n: KEY_NEXTSONG
      C-c: KEY_PLAYPAUSE
ilya-fedin commented 1 month ago

They are mapped to media keys by default in fact and they could be on a completely different key on a different keyboard.

    {
        "command": "media_play",
        "keys": "media play"
    },
    {
        "command": "media_stop",
        "keys": "media stop"
    },
    {
        "command": "media_previous",
        "keys": "media previous"
    },
    {
        "command": "media_next",
        "keys": "media next"
    },
    {
        "command": "media_pause",
        "keys": "media pause"
    },
    {
        "command": "media_playpause",
        "keys": "toggle media play/pause"
    },