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
673 stars 83 forks source link

ToggleFlag does not work on LRC 13.2 / Finnish keyboard #782

Closed tazle closed 4 months ago

tazle commented 4 months ago

Describe the bug "Toggle Flag" function does not seem to be working.

To Reproduce

  1. Assign "Flagging -> Toggle Flag" to a MIDI note.
  2. Play the note.

Expected behavior Expected "pick" flag to toggle.

System(please complete the following information):

rsjaffe commented 4 months ago

How high is the value that the note sends? If you don't hit a note hard enough, MIDI2LR will ignore it as a possible false-positive. Ideally, you'd be sending 127 (the maximum), but anything higher than about 52 or so should work.

tazle commented 4 months ago

It's 127. Also, I was able to bind other actions to the note successfully.

rsjaffe commented 4 months ago

First, look at step 6 of installation and see if that helps: https://github.com/rsjaffe/MIDI2LR/wiki#installation . If not post a copy of MIDI2LR.log that includes you trying that command. If you don’t know where the log is, Lightroom’s help menu will have “generate diagnostic report” in the MIDI2LR section that will show you where it is. https://github.com/rsjaffe/MIDI2LR/wiki/Lightroom-Menus

rsjaffe commented 4 months ago

Also see https://github.com/rsjaffe/MIDI2LR/wiki#faqknown-issues number 2.

tazle commented 4 months ago

I verified that accessibility was enabled, so lack of it doesn't explain why it didn't work, then removed MIDI2LR from the list, restarted LR/MIDI2LR, triggered MIDI2LR re-adding itself to accessibilty, enabled accessibility, restarted LR/MIDI2LR again, and still ToggleFlag is not working. I'll extract the logs next.

tazle commented 4 months ago

Logs:

**********************************************************

Log started: 26 Feb 2024 10:39:36pm

2024-02-26T22:39:36.753+02:00 Misc.h(106) MenuTrans.xml archive loaded from /Users/tuure/Library/Application Support/MIDI2LR/MenuTrans.xml.
2024-02-26T22:39:36.820+02:00 Misc.h(106) ControlsModel archive in Main loaded from /Users/tuure/Library/Application Support/MIDI2LR/settings.xml.
2024-02-26T22:39:36.857+02:00 Misc.h(108) Trying to open input devices.
2024-02-26T22:39:37.424+02:00 Misc.h(106) Opened input device X-TOUCH MINI.
2024-02-26T22:39:37.447+02:00 Misc.h(106) Opened output device X-TOUCH MINI.
2024-02-26T22:39:37.447+02:00 Misc.h(108) Pickup is enabled.
2024-02-26T22:39:37.448+02:00 Misc.h(106) Application: System language en-GB.
2024-02-26T22:39:37.448+02:00 Misc.h(106) Application: CPU Apple M1 Pro.
2024-02-26T22:39:37.448+02:00 Misc.h(106) Application: Application version 6.1.0.0.
2024-02-26T22:39:37.449+02:00 Misc.h(106) Application: Application path /Users/tuure/Library/Application Support/Adobe/Lightroom/Modules/MIDI2LR.lrplugin/MIDI2LR.app.
2024-02-26T22:39:37.449+02:00 Misc.h(106) Application: Profile directory /Users/tuure/Library/CloudStorage/Dropbox/midi2lr-settings.
2024-02-26T22:39:37.449+02:00 Misc.h(106) Application: Log file directory /Users/tuure/Library/Logs/MIDI2LR/.
2024-02-26T22:39:37.449+02:00 Misc.h(106) Application: Settings file directory /Users/tuure/Library/Application Support/MIDI2LR/.
2024-02-26T22:39:37.449+02:00 Misc.h(106) Juce version JUCE v7.0.7.
2024-02-26T22:39:37.449+02:00 Misc.h(108) Socket connected in LR_IPC_In.
2024-02-26T22:39:37.522+02:00 Misc.h(108) Socket connected in LR_IPC_Out.
2024-02-26T22:39:37.538+02:00 Misc.h(106) Plugin: Operating system 14.3.1.23D60 (arm64).
2024-02-26T22:39:37.538+02:00 Misc.h(106) Plugin: Lightroom Version 13.2.
2024-02-26T22:39:37.538+02:00 Misc.h(106) Plugin: Lightroom Language en.
2024-02-26T22:39:37.538+02:00 Misc.h(106) Plugin: Lightroom Preferences path /Users/tuure/Library/Preferences/Adobe/Lightroom.
2024-02-26T22:39:37.538+02:00 Misc.h(106) Plugin: Lightroom Application data path /Users/tuure/Library/Application Support/Adobe/Lightroom.
2024-02-26T22:39:37.538+02:00 Misc.h(106) Plugin: Plugin version 6.1.0.0.
2024-02-26T22:39:37.538+02:00 Misc.h(106) Plugin: Plugin path /Users/tuure/Library/Application Support/Adobe/Lightroom/Modules/MIDI2LR.lrplugin.
2024-02-26T22:39:37.538+02:00 Misc.h(106) Plugin: Plugin log path /Users/tuure/Library/Logs/MIDI2LR.
2024-02-26T22:39:37.538+02:00 Misc.h(106) Plugin: Plugin data path /Users/tuure/Library/Application Support/MIDI2LR.
2024-02-26T22:39:37.727+02:00 Misc.h(106) Version available 6.0.2.0, version last checked 6.0.2.0, current version 6.1.0.0.
2024-02-26T22:39:46.010+02:00 Misc.h(108) 20ms sleep for message queue waiting for FillInMessageLoop to run.
2024-02-26T22:39:46.010+02:00 Misc.h(106) Making KeyMap. Keyboard type Id com.apple.keylayout.Finnish. Localized name = Finnish. Language = fi. KeyMap is true.
2024-02-26T22:39:46.059+02:00 Misc.h(106) Automation permission granted for com.adobe.LightroomClassicCC7.

One thing I noticed that key-based commands (I have something bound to Key 2, and that set up to generate cmd+d to narrow selection) only works when the LR window is in focus, not the MIDI2LR application window. So I checked again that Toggle Flag also doesn't work when the LR window has focus.

Looking at the log, and based on this discussion, I'm thinking that Toggle Flag is more keyboard-based than some of the other commands. On Finnish keyboard some of the shortcuts are not the same as on English keyhboard, and this might be one of them:

image

I think that's a backtick.

tazle commented 4 months ago

If it's backtick, the issue might be that it's a dead key on the Finnish keyboard, i.e. when entering text you first hit apostrophe and then the other key to get e.g. è.

Looking at the Swedish keyboard (which has, at least essentially, the same layout as Finnish) shortcuts at https://www.lightroomqueen.com/keyboard-shortcuts/languages/, it seems to be rebound to <. I wonder why it's ` for me.

Looking at the available shortcuts, I set up cmd + cursor up and cmd + cursor down on a rotary control to work around the issue. Ideally I'd like to be able to toggle pick -> reject -> unflagged using a single button, but setting that up doesn't seem to be feasible as-is.

rsjaffe commented 4 months ago

I think @tazle is correct. This is why the log is so useful. Lightroom does change the keystroke for different languages, and MIDI2LR is able to detect which keystroke is bound to the command in the current user language, so it also changes the keystroke from ` to whatever's bound in that language. However, Lightroom rebinds the key based on the user language selected, not the keyboard language. MIDI2LR takes that keystroke, and, using the keyboard language, converts it to a keycode. That's where I think things go wrong. MIDI2LR must use the keyboard language, as that's how macOS (and Windows too), translate keystrokes to key codes and then to characters.

Try using Keyboard Shortcuts to send the toggle flag command and see if that fixes the problem.

tazle commented 4 months ago

I tried to make a MIDI2LR shortcut for `, but that didn't work either, nor can I enter the shortcut using the keyboard (probable due to it being a dead key).

Adding a custom Mac OS Keyboard Shortcut for "Toggle Flag", and then creating a keyboard shortcut using MIDI2LR for the custom shortcut works.

rsjaffe commented 4 months ago

Lightroom choose shortcut behavior based on interface language, not keyboard language, even though keyboard is the reason shortcuts need language-specific versions. Nothing to fix on my end.