I’m using Keyboard Maestro, and I want to achieve something specific in my software. My goal is simple: I want Shift + mouse scroll to behave exactly like Cmd + mouse scroll.
Is this possible and achievable within Keyboard Maestro? I’m having issues figuring out how to set Shift + mouse scroll as a trigger. I don't want the trigger to be just Shift, as that would interfere with other functionalities. I need to change only the behavior of the Shift + mouse wheel scroll combination to become Cmd + mouse wheel scroll.
Is your mouse programmable? If so, you may be able to reprogram the scroll wheel to send a different USB code which could be capturable by the USB Device Key Trigger in KM, and that could work.
I have one additional thought. Even though the following idea is not a solution, here's a System Settings page that you may not be aware of, which lets you do similar things: (redefine certain modifiers, but Shift is not among them, perhaps because it could mess up so many other things.)
Otherwise, I am unaware of how you could do this. However that doesn't mean it's impossible. There are many people on this website who are more knowledgeable than myself.
Yes, reprogramming the mouse is ideal if possible. Otherwise you can use AppleScript to simulate modifier keys being pressed and released, using the USB device key trigger and the %Trigger% token as a condition.
I'm away at the moment so can't send a macro but it's been covered before on the forum.
Thanks, everyone. I've tried everything, but nothing gives the desired outcome.
My goal, as you know, was to trigger Cmd + Scroll when Shift + Scroll is activated.
Changing the scroll wheel to send a different code than it’s supposed to would mess up other things in the target app. The app already uses basic scrolling for multiple functions, and that behavior is hard-coded into the app. Changing it would problby require some really advanced reverse engineering, which I can't do. So, altering the USB scroll code isn't a solution for me... it makes the app unstable.
By the way, the target app is a video editing software, and you can imagine the scroll wheel already controls intrinsically a lot, like zooming in and out on different panels (e.g., the timeline, the video preview panel). So, changing the behavior of the mouse itself isn’t an option.
Regarding the AppleScript option, I tried using a USB device key trigger with Shift + Scroll as the trigger, and the action was this AppleScript:
tell application "System Events"
key down command --
delay 2 --
key up command --
end tell
But it’s buggy... it works sometimes, and other times it triggers the initial behavior... In short, it is almost unreliable
I’m out of ideas, honestly. Why can’t this be as easy as it is with AutoHotkey on Windows, where a small piece of code works flawlessly?
Because windows and macOS are different. In many ways. Particularly with respect to their APIs.
Another factor is that KM intentionally limits itself to public APIs. Other software for macOS choose to use private APIs. And that causes them other problems which KM won’t have. Have you tried googling your question to see if other macOS apps exist that do what you want?
Thanks for commenting. Btw I tried them all: Karabeiner, BTT .... This is one of the few customisation That I was not able to acheive on any one of those.
I finally got a an average version using Keyboard maestro. It does the job i would say 60%. The main problem is that I feel like with AppleScript things are not pretty reactive for example i HAVE to wait 1 second aprx. until i can reingage the tranformation
PS: In this example photo, I try to trigger option + Scroll wheel using Cmd + Scroll wheel.. ( The same principale is applied to my main request i.e trigerting shift + mouse wheel through cmd + mouse wheel
Partly because on the Mac each "input device" is considered separate. Connect two keyboards, even two identical wired Magic ones, hold down the Shift key on one and hit A on the other and you'll get a lowercase a.
The System Events trick can work because System Events is at a lower level. But, as you've found, there's a delay associated with any AppleScript (or shell, Python, etc) action because a new environment must be instantiated every action. And there's an added small delay because the Pause action isn't "true" the instant you release the ⌘ key, but the next time KM checks to see if ⌘ is down.
Have you tried something that's actually made to interfere with mice? If you haven't looked at SteerMouse yet, give it a go.
And I've held off up to now, but I've got to ask -- why do you want to make Shift-scroll behave like ⌘-scroll? If anything, most people find ⌘ the easier button to press and would want to switch it the other way round!