I’ll have a look! Does the remapping action in general work for you? (you can test it with some other trigger to make sure it’s not a problem with the action)
Please find the attached preset to reproduce these steps:
Assign any shortcut as a trigger (Shift+Esc in the attached preset)
Set its action to "Cycle through multiple actions"
Set action 1 to remap the caps lock to 1 and a hud overlay showing CAPS=1
Set action 2 to remap the caps lock to 2 and a hud overlay showing CAPS=2
Press the shortcut
The hud overlay shows 1 and caps lock types 1
Press the shortcut
The hud overlay shows 2 and caps lock types 1
It seems that the problem is that the first value that a remapped key takes can’t be changed via actions anymore.
If you restart BTT, the issue is not fixed.
If you restart the computer, the caps lock will work as caps lock. If you press the shortcut in this scenario, the caps lock will take the value of 1 or 2. Once the value is assigned, it can’t be changed using the action of the shortcut, as described previously.
In the other hand, I can change the remapping key of the same key at anytime using the ”remap key” trigger in the automations section.
So the trigger can remap multiple times the same key, but the action can only remap a key for the first time.
Another issue I see for remapped keys:
remap key ”F1” to key ”a” in automations section
quit BTT or disable BTT
press F1 and ”b” will still be typed
So the remapping is not removed when BTT is quitted or disabled. If this behaviour is intended, it could be documented in the configuration sidebar to avoid potential problems to users.
If I try to remap keys a to z and 0 to 9 (not keypad numbers) to any other key in the automations section, this remapping is not working. Same for volume_up, volume_down, brightness_up, brightness_down. These keys are working fine in the "To Key: " configuration, but not in the "From Key: ".
Version 4,991 works fine, but there is one unexpected behaviour.
Using the previous preset, try the following:
Remap Caps Lock to key "3" in Automations
Open a new doc in TextEdit
Press the shortcut to toggle between Caps=1 and Caps=2 and press the Caps key to type 1's and 2's in the TextEdit document. This works as expected.
Switch to Finder
Switch to TextEdit again
Press the Caps Lock key and you will type 3 instead of 1 or 2
So it seems that there is a conflict when triggers and actions are remapping the same key if the frontmost app changes.
I understand that the correct behaviour would be that Caps is remapped to Caps=3 when starting BTT due the trigger, and if the shortcut is pressed then Caps would be remapped to Caps=1 or Caps=2 without loosing this last remapping after switching apps.
That's true, always the "last executed" will win. As the ones defined in automations will reload when the app changes, these would override any previously set.
I think it makes sense to give the predefined actions priority, I'll have a look.
4.992 should now always give priority to remappings done via action. However they will not persist BTT restarts - only the ones configured in automations will persist.
I think most should be fine without that option, as BTT in general needs to stay running for its functionality I think it's good to disable the remappings as well when quitting BTT.
It adds quite a bit of complexity to have both options.
So the only pending issue to fix is when disabling BTT: the remapped keys are removed, but they don't recover the original function, they are "frozen".
I have also tried the 3 buttons in the trigger sidebar and none of them are working as expected:
Activate Remapping Now (working well in previous versions)
Reload Remapping Now
Remove All Remapping (working well in previous versions)
Example for Remove All Remapping button:
Remap Caps Lock to "3" in Automations (trigger)
Press the shortcut to remap Caps to "1" (action)
Go to the trigger in BTT/Automations that is remapping Caps=3
Click "Remove All Remappings". Pressing Caps Locks is still typing 1 instead of toggle Caps.
Example for Activate Remapping Now button:
Remap Caps Lock to "3" in Automations (trigger)
Press the shortcut to remap Caps to "1" (action)
Go to the trigger in BTT/Automations that is remapping Caps=3
Optional step: Click "Remove All Remappings"
Click "Activate Remapping Now". Pressing Caps Locks is still typing 1 instead of typing 3.
Example for Reload Remappings Now button:
Remap Caps Lock to "3" in Automations (trigger)
Press the shortcut to remap Caps to "1" (action)
Go to the trigger in BTT/Automations that is remapping Caps=3
Click "Remove All Remappings"
Click "Reload Remappings Now". Pressing Caps Locks is still typing 1 instead of typing 3.
I have tried also (for the first time) the button "Reset All Low Level Key Remappings" in Prefs/Keyboard. It's also not working as expected:
Remap Caps Lock to "3" in Automations (trigger)
Press the shortcut to remap Caps to "1" (action)
Go to Prefs/Keyboard and click "Reset All Low Level Key Remappings"
Pressing Caps Locks is still typing 1 instead of toggle Caps.
The disabling will be supported with the next alpha! I think the buttons are not needed anymore as they would immediately be overridden again by the other logic. I'll remove them (but keep the reset all in the settings)