rsjaffe / MIDI2LR

An application and plugin to remotely control Lightroom with a MIDI controller
http://rsjaffe.github.io/MIDI2LR/
GNU General Public License v3.0
686 stars 83 forks source link

Glitch in config export? #495

Closed sys3175 closed 3 years ago

sys3175 commented 3 years ago

Hi, while reverse engineering your configuration export file, I found that the first hotkey export is different from the others.

Keys={ {alt=false,shift=false,key="j",control=false}, {alt=false,key="l",control=false,command=false,shift=false}, ... as you can see, the order differs and the command key setting is not saved. (I tried to programatically generate the config file and the import fails if I produce all the key entries uniformly in a loop).

Thank you for providing this great utility. Adobe should hire you ;-) I think many people are staying with LR only because of the ease-of-use that you're giving us.

rsjaffe commented 3 years ago

Can you post the file that fails import? The missing command only means that the value is nil, so I assume you're using a windows PC. I'm using a serialization library to produce the export/import, and there is nothing in the code that treats the first hotkey differently from the rest. The order within the curly brackets doesn't matter: it's a matrix of key-value pairs. I will change the code to ensure that command gets set to false instead of nil.

sys3175 commented 3 years ago

Ok, it turns out that this difference was a red herring (sorry for that), my first attempt had a comma missing in the profile list, which I got right in the 2nd try. So the file loads either way, with the shortened 1st key line or a full 1st one like the 2nd line above. So, no need to change the code, everything works fine, I just was under the impression that there might arise problems if not all values are exported.

rsjaffe commented 3 years ago

Lua treats nil (missing values) like false in most circumstances, so missing values are not an issue in this instance, but I will set it to false if missing just to make things more consistent.