<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Multimedia on Major Hayden</title><link>https://major.io/tags/multimedia/</link><description>Recent content in Multimedia on Major Hayden</description><generator>Hugo</generator><language>en</language><managingEditor>major@mhtx.net (Major Hayden)</managingEditor><webMaster>major@mhtx.net (Major Hayden)</webMaster><copyright>All content licensed [CC BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/)</copyright><lastBuildDate>Sun, 10 May 2026 09:15:13 +0000</lastBuildDate><atom:link href="https://major.io/tags/multimedia/index.xml" rel="self" type="application/rss+xml"/><item><title>Configure multimedia keys on a Ducky One keyboard</title><link>https://major.io/p/ducky-keyboard-multimedia-keys/</link><pubDate>Mon, 05 Dec 2022 00:00:00 +0000</pubDate><author>major@mhtx.net (Major Hayden)</author><guid>https://major.io/p/ducky-keyboard-multimedia-keys/</guid><description>&lt;p&gt;My Ducky One 2 keyboard arrived around two years ago and I love it.
I type more accurately and that clackety sound gives me that old computer feeling.
&lt;em&gt;(I went with Cherry MX Blue switches.)&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Although it proviees some basic controls for media, such as muting and adjusting volume, there are no buttons for pausing music or switching to different tracks.
That function exists, but it takes some configuration to work.&lt;/p&gt;
&lt;h2 id="handling-media-keys"&gt;Handling media keys&lt;/h2&gt;
&lt;p&gt;For those of you running a large desktop environment like GNOME or KDE, you likely have built-in multimedia key handling in the environment.
However, I use sway and i3 and there&amp;rsquo;s no native handling there.&lt;/p&gt;
&lt;p&gt;There&amp;rsquo;s a great utility called &lt;a href="https://github.com/altdesktop/playerctl"&gt;playerctl&lt;/a&gt; that makes this really easy.
If you&amp;rsquo;re on Fedora, run &lt;code&gt;dnf install playerctl&lt;/code&gt; to get started.&lt;/p&gt;
&lt;p&gt;Next, you&amp;rsquo;ll need some hotkeys in i3/sway:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;bindsym XF86AudioPlay exec playerctl play-pause
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;bindsym XF86AudioNext exec playerctl next
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;bindsym XF86AudioPrev exec playerctl previous
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Press &lt;code&gt;Mod+Shift+c&lt;/code&gt; to reload your Sway/i3 configuration.&lt;/p&gt;
&lt;p&gt;These are the standard multimedia keys that many keyboards have, but my Ducky keyboard doesn&amp;rsquo;t have them.
The keyboard does have the ability to send these keystrokes through, but we need to set up a macro for them!
&lt;em&gt;Skip to the next section for that.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;But before we go, playerctl handles all kinds of different multimedia players on your system:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-console" data-lang="console"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="gp"&gt;$&lt;/span&gt; playerctl -l
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="go"&gt;firefox.instance4056
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="go"&gt;spotify
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;I tend to use my media keys for Spotify most often, so I updated my Sway/i3 configuration to this:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-console" data-lang="console"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="go"&gt;bindsym XF86AudioPlay exec playerctl -p spotify play-pause
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="go"&gt;bindsym XF86AudioNext exec playerctl -p spotify next
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="go"&gt;bindsym XF86AudioPrev exec playerctl -p spotify previous
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This ensures that my media keys won&amp;rsquo;t interfere with something in Firefox and will always control my Spotify media. 😉&lt;/p&gt;
&lt;p&gt;🚨 &lt;strong&gt;Before going any further, check that &lt;code&gt;playerctl&lt;/code&gt; works!&lt;/strong&gt; 🚨&lt;/p&gt;
&lt;p&gt;Run &lt;code&gt;playerctl -p spotify play-pause&lt;/code&gt; one time and your music should play if it wasn&amp;rsquo;t playing before, or it should pause if it was already playing.
Run it one more time to ensure it does the opposite the second time.
Use a different player or remove the &lt;code&gt;-p&lt;/code&gt; argument entirely to test it with other players.&lt;/p&gt;
&lt;h2 id="rtem-read-the-excellent-manual"&gt;RTEM (Read the excellent manual)&lt;/h2&gt;
&lt;p&gt;The Ducky One 2 has a &lt;a href="https://duckychannel.net/download/user_manual/2020/Ducky_One_One2_10in1_usermanual_ol.pdf"&gt;helpful manual&lt;/a&gt; in English and Chinese.
We need a macro to get the multimedia keys working and that process isn&amp;rsquo;t easy to follow as it spans multiple pages.&lt;/p&gt;
&lt;p&gt;📚 &lt;em&gt;If you need a manual for a different Ducky keyboard, their &lt;a href="https://www.duckychannel.com.tw/en/Support"&gt;support page&lt;/a&gt; has a wizard that helps you find the exact manual for your keyboard.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;The good stuff starts at page 41 in my manual:&lt;/p&gt;
&lt;p&gt;&lt;img alt="Manual page explaining how to switch between profiles" loading="lazy" src="https://major.io/p/ducky-keyboard-multimedia-keys/manual-page-41.png"&gt;&lt;/p&gt;
&lt;p&gt;First, determine which profile you want to use.
In my case, I chose profile 2.&lt;/p&gt;
&lt;p&gt;Next, we need to know which multimedia function keys are hidden away in the keyboard&amp;rsquo;s firmware:&lt;/p&gt;
&lt;p&gt;&lt;img alt="Manual page covering multimedia keys" loading="lazy" src="https://major.io/p/ducky-keyboard-multimedia-keys/manual-page-43.png"&gt;&lt;/p&gt;
&lt;p&gt;For each key combination, we need to know which keys we want to press to trigger the multimedia key (letters above).
I&amp;rsquo;m most interested in play/pause, previous track, and next track, so I&amp;rsquo;m building out my configuration like this:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Play/Pause: &lt;code&gt;Fn+End&lt;/code&gt; (key &lt;code&gt;D&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Previous track: &lt;code&gt;Fn+PgUp&lt;/code&gt; (key &lt;code&gt;G&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Next track: &lt;code&gt;Fn+PgDown&lt;/code&gt; (key &lt;code&gt;F&lt;/code&gt;)&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="making-macros"&gt;Making macros&lt;/h2&gt;
&lt;p&gt;Now we&amp;rsquo;re ready to record a macro.&lt;/p&gt;
&lt;p&gt;Switch to profile 2 with &lt;code&gt;Fn+2&lt;/code&gt;.
The LED underneath the &lt;em&gt;2&lt;/em&gt; should blink briefly.&lt;/p&gt;
&lt;p&gt;Enter macro mode by holding down &lt;code&gt;Fn&lt;/code&gt; and &lt;code&gt;Ctrl&lt;/code&gt; for three seconds (press &lt;code&gt;Fn&lt;/code&gt; first, though).
The keyboard indicators at the top right of the keyboard should be blinking slowly.&lt;/p&gt;
&lt;p&gt;Carefully set the macro:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Hold down &lt;code&gt;Fn&lt;/code&gt; and &lt;code&gt;Ctrl&lt;/code&gt; for three seconds. Indicator lights should blink slowly.&lt;/li&gt;
&lt;li&gt;Hold &lt;code&gt;Fn&lt;/code&gt; and press &lt;code&gt;End&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Hold &lt;code&gt;Fn&lt;/code&gt;, then hold the Windows key, then press &lt;code&gt;D&lt;/code&gt; (for play/pause). Release all keys after pressing &lt;code&gt;D&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Exit macro recording mode by holding &lt;code&gt;Fn&lt;/code&gt; and pressing &lt;code&gt;Ctrl&lt;/code&gt;. Release all keys.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Repeat for previous track:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Hold down &lt;code&gt;Fn&lt;/code&gt; and &lt;code&gt;Ctrl&lt;/code&gt; for three seconds. Indicator lights should blink slowly.&lt;/li&gt;
&lt;li&gt;Hold &lt;code&gt;Fn&lt;/code&gt; and press &lt;code&gt;PgUp&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Hold &lt;code&gt;Fn&lt;/code&gt;, then hold the Windows key, then press &lt;code&gt;G&lt;/code&gt; (for previous track). Release all keys after pressing &lt;code&gt;D&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Exit macro recording mode by holding &lt;code&gt;Fn&lt;/code&gt; and pressing &lt;code&gt;Ctrl&lt;/code&gt;. Release all keys.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Finally for next track:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Hold down &lt;code&gt;Fn&lt;/code&gt; and &lt;code&gt;Ctrl&lt;/code&gt; for three seconds. Indicator lights should blink slowly.&lt;/li&gt;
&lt;li&gt;Hold &lt;code&gt;Fn&lt;/code&gt; and press &lt;code&gt;PgDn&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Hold &lt;code&gt;Fn&lt;/code&gt;, then hold the Windows key, then press &lt;code&gt;F&lt;/code&gt; (for next track). Release all keys after pressing &lt;code&gt;D&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Exit macro recording mode by holding &lt;code&gt;Fn&lt;/code&gt; and pressing &lt;code&gt;Ctrl&lt;/code&gt;. Release all keys.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id="testing"&gt;Testing&lt;/h2&gt;
&lt;p&gt;You did test &lt;code&gt;playerctl&lt;/code&gt; by itself earlier, right? 😜
If you didn&amp;rsquo;t, go back to the first section and save yourself some frustration.&lt;/p&gt;
&lt;p&gt;Press &lt;code&gt;Fn+End&lt;/code&gt; and your music should toggle between playing and paused.
Press &lt;code&gt;Fn+End&lt;/code&gt; once more and it should toggle again.&lt;/p&gt;
&lt;p&gt;If &lt;code&gt;playerctl&lt;/code&gt; works on the command line, but doesn&amp;rsquo;t work via the keyboard macro, you can go back through the macro setting steps above.
You can also clear a macro from a key by holding &lt;code&gt;Fn+Ctrl&lt;/code&gt; for three seconds, tapping the misconfigured key, tapping the same key again, and pressing &lt;code&gt;Fn+Ctrl&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Enjoy your quick access to multimedia keys! ⌨ 🎶&lt;/p&gt;</description></item></channel></rss>