Allow binding two keys to the same control

Bug #1529708 reported by Christopher Cooper
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mixxx
Confirmed
Wishlist
Unassigned

Bug Description

It should be possible to bind multiple keys on the keyboard to the same control. Currently, due to the fact that the keyboard shortcuts are defined in a config file, there is no way to do this.

Possible use case: Shift+@ is set to activate a rolling loop. To halve the loop, I attempt to press w, but since I'm holding down Shift+@, this registers as Shift+W. However, I can't bind both w and Shift+W to halve_loop.

This could be accomplished by modifying the format of the keyboard config file to take a list of space-separated key sequences for each control. For example, in the keyboard config file:

[Channel1]
loop_halve w Shift+W

Internally, this can be accomplished by modifying the ConfigValueKbd class to have a list of key sequences instead of a single key sequence. A proof of concept patch on the current master (commit 4d4fc62e08e99127036d5c3a25fcb41d16015867) is attached. This code is also available at my fork of mixxx (https://github.com/cg505/mixxx/tree/multi-key). This code compiles and works on my system (Fedora 22 x86_64).

I'd be happy to open a pull request or improve/rebase the patch as needed. Thanks for taking a look.

Tags: keyboard
Revision history for this message
Christopher Cooper (cg505) wrote :
description: updated
RJ Skerry-Ryan (rryan)
Changed in mixxx:
importance: Undecided → Wishlist
status: New → Confirmed
Revision history for this message
RJ Skerry-Ryan (rryan) wrote :

Thanks for the patch Christopher (and welcome!)

For backwards compatibility with previous versions of Mixxx I would prefer if the file format worked like this:

[Channel1]
loop_halve w
loop_halve Shift+W

That way older versions would just read a single loop_halve association.

Please do open a pull request if you're interested in working on this further!

Revision history for this message
Christopher Cooper (cg505) wrote :

Thanks!

I would also prefer that format, but I think it's hard to support it without overhauling a lot of the config system. That's why I went with the scheme above. That said, I'll take a look to see what I can do, and open a pull request when I think it's ready.

Also, I think (but am not sure, I need to look back at the source, but I'm not at my computer right now) that older versions of mixxx will only read up to the first space, so only one key sequence would be read anyway. I may be wrong, though.

Revision history for this message
RJ Skerry-Ryan (rryan) wrote :

yea, I realize that code is a giant mess :)

Revision history for this message
Swiftb0y (swiftb0y) wrote :

Mixxx now uses GitHub for bug tracking. This bug has been migrated to:
https://github.com/mixxxdj/mixxx/issues/8391

lock status: Metadata changes locked and limited to project staff
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.