Announcement

Collapse
No announcement yet.

Media Controller Keys In Applications

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    [KDE] Media Controller Keys In Applications

    Some Media Controller keys are available as Global Shortcuts and will control some multimedia programs such as Amarok and Quodlibet. The Media Controller keys are those that appear as alternative functions to the Function keys in laptops and desktop keyboards; such as 'Play', 'Rewind' and 'Forward'.

    They are pretty useless and are usually avoided in favour of other, more convenient, keystrokes like 'Space' for 'Play/Stop'.

    I built an Arduino-based Media Controller keypad as a really useful adjunct to audio recording programs such as DAWs (e.g. Reaper) and Audacity. It works beautifully in Windows, but is a total bust on Kubuntu because Kubuntu does not pass the keystrokes to applications. The few Global Shortcuts entered for Media Controller, only work with one or two media player programs and there seems to be no way of adding the missing Media Controller functions such as 'Record'..

    The multimedia applications, typically, allow keystrokes to be associated with functions via shortcut preferences. The function (e.g. 'Play' or 'Record') is selected and the desired keystroke is entered on the keyboard (e.g.'P' or <Shift-F6>). As far as I can tell, xev displays all of the available Media Controller keys, but none of them register in application keyboard shortcut preferences.

    Thus the applications that will most benefit from a Media Controller keypad are excluded by KDE. I am informed that Ubuntu and Ubuntu Studio do not suffer from this problem and, as I have found, neither does Windows. Is there a fix for this problem? Can Windows really be better than Kubuntu for audio and video recording!

    #2
    I think it's a Qt vs. GTK thing.

    For Qt programmes, using system settings, shortcuts, custom shortcuts, you could set up a mapping to another key chord or sequence. I've just mapped my MediaPlay button that way. I've found that whole screen idiosyncratic, at best. But, non-Qt programmes don't get it; at least, mine don't.

    Another way to do this sort of thing is via a DBUS interface, but I don't know if the programmes you use expose such an interface, and IME it gets complicated, and rarely documented well. The qdbus command is a clunky way to explore what's on the bus, and qdbusviewer much nicer, but that's a Qt development tool and installing its package (qttools5-dev-tools, found by using apt search) pulls in a bunch of Qt development stuff.

    xdotool might work, but I doubt it. It works with firefox. This would be using the custom shortcut to run a command. xdotool's window search functions have baffled me, as well as being a bit flaky, so I'd use wmctrl command to identify the window. F.ex.,
    Code:
    xdotool key --window $(wmctrl -lx | awk '/Firefox.*Media/{print $1}') Ctrl+0
    finds the firefox window in which I'm typing this post, and resets the zoom level. I set a custom short cut to run this on the MediaPlay key; pressed it and firefox obliged.
    Regards, John Little

    Comment

    Working...
    X