How to make a custom keyboard mapping for Mixxx

[size=150]Defaults[/size]
The default keyboard shortcuts are documented in the Mixxx Manual. A PDF of the Mixxx manual came with your install of Mixxx, however, you’ll find a full table of the keyboard shortcuts, as well as a printable keyboard overlay here: Mixxx Manual

The default keyboard shortcuts are defined in a text file which can be found at the following location:

  • Linux: /usr/local/share/mixxx/keyboard/en_US.kbd.cfg
  • Mac OS X: /Applications/Mixxx.app/Contents/Resources/keyboard/en_US.kbd.cfg
  • Windows: \keyboard\en_US.kbd.cfg

Depending on your systems language settings, Mixxx might use a different file as default, e.g de_DE.kbd.cfg for German or es_ES.kbd.cfg for Spanish.

[size=150]Customizing[/size]
There are two ways to customize the keyboard mapping:

    1. Edit your systems default mapping file directly , e.g. en_US.kbd.cfg
    1. Copy the default shortcut file to the following location and rename to Custom.kbd.cfg :
    • Linux: ~/.mixxx/Custom.kbd.cfg
    • MacOSX: /Library/Application\ Support/Mixxx/Custom.kbd.cfg
    • Windows: %USERPROFILE%\Local Settings\Application Data\Mixxx\Custom.kbd.cfg
      Then edit Custom.kbd.cfg and save the changes. On the next startup, Mixxx will check if Custom.kbd.cfg is present and load that file instead of the standard mapping file. This has the advantage that you can’t screw up and can always go back to the original mapping, just by deleting Custom.kbd.cfg

For a list of controls that can be used in the keyboard mapping, see the MixxxControls topic in the Mixxx Wiki.

You can share and download custom keyboard mappings in the Mixxx User customizations forum.

Another interesting tip is using the command line option --developer to show the key binding names you have pressed.

What if I want to use the arrow keys for crossfader/volume adjustment? What are the keycodes for the arrow keys?

My apologies. Upon further googling I found this thread: mixxx.org/forums/viewtopic.php?f=9&t=2077

Can I use the Javascript for the Keyboard mappings ?

Unfortunately, no, the keyboard system is separate from the controller system.

OK. Would plugging in another separate keyboard help ? I notice there’s a “HID Keyboard.hid.xml.example” in “Mixxx\controllers” that at least suggests something can be done with Javascript and a keyboard. It appears to implement packet polling of a Bluetooth keyboard, alhtough I think one of the scripts is missing.

It seems ironic that the keyboard is not treated as just another HID device because it was one of the first HID devices ever. Mixxx keyboard shortcuts are great but I need a bit more functionality like being able to increase and decrease sliders smoothly by holding down a key. If we’re sure there is no way of doing this I’ll put in a feature request.

Actually you are correct. You can treat a keyboard as an HID controller and write an HID controller mapping, but that means it will not work as a normal keyboard while Mixxx is running and you cannot use the keyboard shortcut system.

OK, thanks. I connected a second USB keyboard and both Windows and Mixxx can see it. Now I just need an example mapping file for use with the keyboard.

Where is “Apple Bluetooth Keyboard.js” ? …

“c:\Program Files\Mixxx\controllers\HID Keyboard.hid.xml.example”

<?xml version="1.0" encoding="utf-8"?> <MixxxControllerPreset schemaVersion="1" mixxxVersion="1.11+"> <info> <name>Apple Bluetooth Keyboard</name> <author>Ilkka Tuohela</author> <description>HID example for Apple Bluetooth Keyboard</description> <devices> <product protocol="hid" vendor_id="0x5ac" product_id="0x23a" usage_page="0x1" usage="0x6" interface_number="0x1" /> </devices> </info> <controller id="Apple Bluetooth Keyboard"> <scriptfiles> <file filename="common-hid-packet-parser.js" functionprefix=""/> <file filename="common-hid-devices.js" functionprefix=""/> <file filename="Apple Bluetooth Keyboard.js" functionprefix="AppleBluetoothKeyboard"/> </scriptfiles> </controller> </MixxxControllerPreset>

Unless it was never written.

Up
Down
Left
Right
mixxx.org/forums/viewtopic.php?f=9&p=7891