Oh great, the mail did not quite arrive with the styling and layout I had in 
mind. But although it is not so ordered, I hope that it is still 
understandable! Sorry.
From: jordi...@hotmail.com
To: mixxx-devel@lists.sourceforge.net
Date: Thu, 18 Aug 2016 16:34:32 +0200
Subject: [Mixxx-devel] KeyboardController PR ready (#966)




Hi developers,
I am sure you will have seen me around here on the mailing list. But just to be 
sure: I am Jordi, one of this year's GSoC students. And although I did not 
manage to finish the initial project as described in the proposal I managed to 
get quite some work done. Just before the mid-term evaluation, I made a [Work 
in progress] pull request on the branch I had been working on. Since then I 
have been working on internationalization on a different branch and I want to 
announce that the PR is updated and ready, with internationalization included :)
The PR's name is KeyboardController, 
#966.https://github.com/mixxxdj/mixxx/pull/966#
The basic idea of the PR is in the PR description. The working of the keyboard 
controller should be deductible from the code. But here some extra explanations 
and questions:No more ConfigValueKbd  Because of a weird bug that made it 
impossible to distinguish key Q from key S on the Greek keyboard layout, we 
were forced to abandon the current mapping storing / compare approach using 
ConfigValueKbd. Here is a description of what the problem was, with code 
examples:
http://pastebin.com/v4KVmrD4Instead of using ConfigValueKbd (it uses 
QKeySequence under the hood, that was the problem) we now use QString instead:
https://github.com/Tomasito665/mixxx/commit/93a48a277b3ac0495174699686a4c55a6fd49235#diff-b01bf5efe5a054f3c1eea758ab5ab84dL39However,
 although ConfigValueKbd is technically not used anymore, the class is not yet 
removed. I wanted your opinion on whether we should remove it or not.So, should 
we remove it forever?Or maybe make it use QString under the hood?
What we fixed with the new approach (see latest emails between me and Daniel to 
see details) is:We can now distinguish between unmodified keys W and S on the 
Greek layout.
However, we can still not distinguish between those keys when modified. That 
means that we can still not map on:Ctrl+W, Ctrl+S, Shift+W, Shift+S, 
Ctrl+Alt+W, Ctrl+Alt+S, Ctrl+Shift+W and Ctrl+Shift+S. But since the default 
mapping doesn't use any of those, it's OK for now.

Enabling / disabling keyboard controllerThe user can enable / disable the 
controller both via controller preferences and via main menu bar's Enable 
Keyboard Shortcuts checkbox. I decided not to remove the [Keyboard], enabled 
config key in mixxx.cfg, for backwards-compatibility. However, that just means 
that if a user had the keyboard shortcuts disabled before the Mixxx upgrade, 
the KeyboardController will be also disabled after the upgrade. We could 
probably just get rid of it and make the Upgrade class translate the legacy 
enabled reflection to the new one.
Controller config key used for all 
controllershttps://github.com/mixxxdj/mixxx/blob/master/src/controllers/controllermanager.cpp#L352
Legacy config 
keyhttps://github.com/mixxxdj/mixxx/pull/966/files#diff-69e2520577930d1a7419a8572e2cecabR892
What do you think, should we drop the legacy one?Keyboard controller 
presetsKeyboard mappings are stored to disk as *.kbd.xml files and can hold 
mappings for multiple keyboard languages. However, it usually just contains 
info for one layout. That's because Mixxx is now able to translate key 
sequences from one keyboard layout to the other, runtime. Therefore, it is 
possible to start Mixxx with keyboard layout en_US, switch to ru_RU and then to 
el_GR and the keyboard mappings will keep working on each switch (naturally, 
tooltips will update as well).
The XML format we are currently using 
is:https://github.com/mixxxdj/mixxx/pull/966/files#diff-f1aa1cbdcaf8b1f055989ea9b7fd1c66R144
Note how sometimes a control is bound explicitly for a specific 
layout:https://github.com/mixxxdj/mixxx/pull/966/files#diff-f1aa1cbdcaf8b1f055989ea9b7fd1c66R158
We are now binding to key sequences in two ways:Key sequences that are based on 
position:
q, w, e, r, t, y, etc. 

We target these like this:
<keyseq lang="en_US" scancode=16>q</keyseq>

Key sequences that are not based on position:
Space, Left, Up, Right, Down, Tab, Backspace, Enter, F1, F2, F3, etc.

We target these like this:
<keyseq final='1'>F1</keyseq>

However, this format contains redundant information as explained by Daniel in 
this comment:https://github.com/mixxxdj/mixxx/pull/966#discussion_r75291929
So, expect some changes in the coming days to the format. Any suggestions are 
welcome!

                                        

------------------------------------------------------------------------------
_______________________________________________ Get Mixxx, the #1 Free MP3 DJ 
Mixing software Today http://mixxx.org Mixxx-devel mailing list 
Mixxx-devel@lists.sourceforge.net 
https://lists.sourceforge.net/lists/listinfo/mixxx-devel                        
                  
------------------------------------------------------------------------------
_______________________________________________
Get Mixxx, the #1 Free MP3 DJ Mixing software Today
http://mixxx.org


Mixxx-devel mailing list
Mixxx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mixxx-devel

Reply via email to