@Ferran: What do you exactly mean by treating different keyboard layouts as 
different controllers?
The last two days I have been working on a script that iterates all kbd.cfg 
files in a given folder and generates one kbd.xml file. When given the 
{mixxx-dir}/res/keyboard folder, it outputs this 
XML:http://pastebin.com/B18fTnsC
I think that the file speaks for itself. But here are some key characteristics:
The <controller> block starts with a <keyboard-layouts> block, which is kind of 
a manifest, telling which keyboard layouts this keyboard preset supports.Each 
<control> element is child element of a <group> element, which has an attribute 
"name", which tells the group name:
<group name="[Master]">
<!-- This control will target the ConfigKey: [Master], crossfader_up 
--><control action="crossfader_up"></control></group> 
Each <control> block can have multiple <keyseq> elements, which hold a key 
sequence. In Mixxx, this key sequence will be loaded in as q QKeySequence.
Each <keyseq> element can have a "lang" attribute, which tells for which of the 
supported layouts as described in <keyboard-layouts> this key sequence is 
targeted. For example:
<control action="beatloop_4_toggle"><keyseq lang="en_US">q</keyseq>
<keyseq lang="fr_FR">a</keyseq></control>
If a key sequence is shared by multiple keyboard layouts, it can be grouped 
like this:<keyseq lang="en_US, fr_CH, es_ES, de_CH">q</keyseq>
If a key sequence is shared by all the keyboard layouts supported by the 
preset, the lang attribute is not set:
<keyboard-layouts><lang>en_US</lang><lang>fr_CH</lang><lang>es_ES</lang><lang>de_CH</lang><lang>fr_FR</lang></keyboard-layouts>
...
<control action="enabled">
<!-- This key sequence is shared by all keyboard layouts, because it lacks a 
lang attribute --><!-- So. In this case, it will target: en_US, fr_CH, es_ES, 
de_CH and fr_FR. -->
<keyseq>Shift+F12</keyseq></control>
I am curious about what your thoughts are on the generated file!

> To: ferranpujolcam...@gmail.com
> From: dasch...@mixxx.org
> Date: Fri, 24 Jun 2016 21:52:14 +0200
> CC: mixxx-devel@lists.sourceforge.net
> Subject: Re: [Mixxx-devel] Multiple language keyboard mapping
> 
> A user in country with a non Latin charset (like Russian), might switch 
> the keyboard layout during a Mixxx run.
> I am afraid it will be hard for Mixxx to predict which Layout a user 
> will use during a run. So how will Mixxx decide which Controller for a 
> specific layout should be enabled?
> 
> 
> Am 24.06.2016 um 21:38 schrieb Ferran Pujol Camins:
> > What about treating different keyboard layouts as different controllers?
> > So a users would only see mappings corresponding to their layout.
> >
> > 2016-06-23 0:47 GMT+02:00 Daniel Schürmann <dasch...@mixxx.org
> > <mailto:dasch...@mixxx.org>>:
> >
> >     Hi Jordi,
> >
> >     great! This would fix:
> >     https://bugs.launchpad.net/mixxx/+bug/997811
> >
> >     Kind regards,
> >
> >     Daniel
> >
> >     Am 23.06.2016 um 00:15 schrieb Jordi Ortolá Ankum:
> >     > Hi folks!
> >     >
> >     > Now that I am working on the Keyboard Controller
> >      > <https://github.com/mixxxdj/mixxx/pull/966> I am re-implementing all
> >     > aspects of the keyboard, but in the form of a controller. One of those
> >     > aspects is supporting multiple keyboard layouts for different 
> > languages
> >     > and choosing the right one depending on the current locale.
> >     >
> >     > Currently we have 12 different files, one file per keyboard layout
> >     > (en_US.kbd.cfg, es_ES.kbd.cfg, etc), from which one is loaded in while
> >     > booting Mixxx (if custom mapping isn't found). But now, if the 
> > keyboard
> >     > is a controller and is listed under "preferences -> controllers", it 
> > is
> >     > suddenly possible to change keyboard mapping 
> > (KeyboardControllerPresets)
> >     > at runtime by clicking on the preset dropdown menu.
> >     >
> >     > Now here is the thing. If we keep having one file per language, that
> >     > means that me, having a en_US keyboard layout, I will also get the
> >     > russian keyboard layout listed as an option. As a user I shouldn't be
> >     > amused (no offense to the Russians ^^, the same goes for other foreign
> >     > layouts), especially considering that I just wanted to go and choose 
> > the
> >      > default mapping. /But oh, wait.. there are 12 default mapping
> >     presets?/
> >     >
> >     > I would say that if those 12 different presets, which actually 
> > represent
> >     > the same mapping, where just in one file: Default.kbd.xml, that would 
> > be
> >     > a lot clearer. I propose to make the new keyboard presets 
> > multi-language
> >     > compatible and ship just one file, containing default mappings for all
> >     > languages. When the user selects a preset and the XML is parsed, it
> >     > would only load in the mapping for the current local keyboard layout 
> > or
> >     > default to en_US if the selected preset doesn't support your layout. 
> > If
> >     > the keyboard layout was changed at runtime, the keyboard controller
> >     > would go and see if the current preset has mappings for the new 
> > keyboard
> >     > layout, and if found, load them in.
> >     >
> >     > What do you think?
> >     >
> >     > --Jordi
> >     >
> >     >
> >      >
> >     
> > ------------------------------------------------------------------------------
> >      > Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park
> >     in San
> >      > Francisco, CA to explore cutting-edge tech and listen to tech
> >     luminaries
> >      > present their vision of the future. This family event has
> >     something for
> >      > everyone, including kids. Get more information and register today.
> >      > http://sdm.link/attshape
> >      >
> >      >
> >      >
> >      > _______________________________________________
> >      > Get Mixxx, the #1 Free MP3 DJ Mixing software Today
> >      > http://mixxx.org
> >      >
> >      >
> >      > Mixxx-devel mailing list
> >      > Mixxx-devel@lists.sourceforge.net
> >     <mailto:Mixxx-devel@lists.sourceforge.net>
> >      > https://lists.sourceforge.net/lists/listinfo/mixxx-devel
> >      >
> >
> >     
> > ------------------------------------------------------------------------------
> >     Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
> >     Francisco, CA to explore cutting-edge tech and listen to tech luminaries
> >     present their vision of the future. This family event has something for
> >     everyone, including kids. Get more information and register today.
> >     http://sdm.link/attshape
> >     _______________________________________________
> >     Get Mixxx, the #1 Free MP3 DJ Mixing software Today
> >     http://mixxx.org
> >
> >
> >     Mixxx-devel mailing list
> >     Mixxx-devel@lists.sourceforge.net
> >     <mailto:Mixxx-devel@lists.sourceforge.net>
> >     https://lists.sourceforge.net/lists/listinfo/mixxx-devel
> >
> >
> 
> ------------------------------------------------------------------------------
> Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
> Francisco, CA to explore cutting-edge tech and listen to tech luminaries
> present their vision of the future. This family event has something for
> everyone, including kids. Get more information and register today.
> http://sdm.link/attshape
> _______________________________________________
> 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
                                          
------------------------------------------------------------------------------
Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape
_______________________________________________
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