Support custom keyboard mappings from UI and skin

Registered by Ilkka Tuohela on 2014-07-11

Mixxx needs better keyboard UI customization and support for custom bindings in skins.

Background information:
- Skins in 1.12 can define new functionality, like 'show or hide section of UI' by registering new attributes and assigning a control to the attribute (for example with a push button). It's not possible to assign keyboard shortcuts to these attributes in skin or by user in keyboard.cfg
- Keyboard settings are hard to configure or select: keyboard layouts are stored in application, not in user data, and layout is chosen by locale, not from user settings. However, setting locale may also change UI language and you can't have multiple alternative keyboard layouts for same locale
- It's not clear which keyboard shortcuts are possible to define in keyboard.cfg or what is the name of the control

Suggested changes:
- Allow selecting system keyboard layout explicitly in preferences in addition to locale based selection, store layout name in mixxx.cfg without copying system layout to user directory: (for example, my locale is en_GB but I use fi_FI keyboard)
- Allow storing user keyboard shortcuts in user configuration directory file custom_keyboard.cfg
- Add a page to preferences for keyboard shortcuts, where user can see, add and remove keyboard shortcuts with UI
- Allow defining new virtual keyboard shortcuts in skins, with default shortcuts ('hide decks and mixers', 'show effect rack 2')
- Add a small dialog 'Map keyboard shortcuts' that can be opened from 'View' menu to map shortcuts directly in UI
- File bugs / fix any controls in UI where a shortcut is not available
- Figure out how we can find all possible keyboard controls available in a UI element (move slider up/down, reset slider value etc.)

Example how user would use the keyboard mapping UI dialog:
- Select 'Map keyboard shortcuts' from 'View' menu -> a small movable, separate dialog window opens
- Select a control from mixxx UI -> the control name is filled into the mapping dialog with current shortcut
- Press a keyboard combination -> the keyboard shortcut for the mapping is updated in mapping dialog
- Press 'Undo' in mapping dialog -> accidentally selected new custom mapping for current shortcut is reverted to previous value in dialog
- User selects conflicting keyboard shortcut in mapping dialog -> Mapping dialog shows 'shortcuts conflicts with shortcut x' and does not yet apply the shortcut
- User presses 'Replace' in mapping dialog -> new shortcut is applied to current control and previous shortcut is disabled
- User closes keyboard shortcut mapping dialog -> a confirmation window is shown with new mappings with 'Cancel' and 'Save' buttons

Resolving conflicting controls:
- Read skin and it's additional custom keyboard shortcuts (custom pushbuttons with custom attributes)
- Read system keyboard.cfg selected in user preferences. May override skin defined shortcuts to be consistent between skins
- Read keyboard_shortcuts.cfg from user configuration directory if found. May override or undefine both skin and system shortcuts and add it's own: this file should normally be modified the proposed UI

Blueprint information

Status:
Not started
Approver:
None
Priority:
Undefined
Drafter:
Ilkka Tuohela
Direction:
Needs approval
Assignee:
None
Definition:
New
Series goal:
None
Implementation:
Unknown
Milestone target:
None

Related branches

Sprints

Whiteboard

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.