Scroll Mouse Up with Control Down — doesn't work

Scroll Mouse Up with Control Down — doesn't work

I need this, in exactly this order:

  • press and hold ⌃
  • simulate scroll wheel up
  • release ⌃

Here's why:

I can't figure out a way to do this purely in KM. It seems to me the following should work, but all it does is scroll up 100. There is no evidence the control key is down. Ideas?

1 Like

This doesn't work either; in fact it does nothing. (The alert isn't sounded.) It is activated by
⌃F1. It should scroll up 100 every 1.5 seconds until I release .

Copying @Tom’s comment over to here:

Yes, I discovered that too -- that the macro keystroke had to be a control modified key. My problem is that my macro doesn't do anything even then. What had envisioned is behavior like Zoom In/Out in standard applications — let's say every time I press ⌃+ it magnifies further, and every time I press ⌃–. Actually I'd be content with something much simpler: I magnify the normal way, and ⌃0 snaps back to no magnification by control-scrolling down by a large number of pixels.

1 Like

Probably a dumb question: why don’t you just use the system’s shortcuts?

If you are not happy with ⌥⌘= you can set it to whatever you want.

1 Like

Not a dumb question at all. The behavior of ⌥⌘= is fine, though I wish it jumped by larger increments (which I could fix with a KM macro that simulates N ⌥⌘= keystrokes). The specific goal was to snap back to no magnification. I envisioned simply scrolling down by a large amount. Well, combining your comment with my parenthetical though, I can just have a keystroke that simulated a large enough number of ⌥⌘– keystrokes to snap back to no magnification. Thanks for the suggestion.

I just discovered this:

Have you checked this? (It’s behind the More Options… button of the Zoom pane.)

  1. While holding down ⌃⌥ you zoom in with the scroll wheel up to the magnification you desire.
  2. Then you release ⌃⌥ and it snaps back to zero.
  3. When you press ⌃⌥ again —without scrolling— it goes (in one step) exactly to the magnification you have set before.

Isn’t it this what you are looking for?

1 Like

Never saw that one! Many thanks. Another example demonstrating that one should start with what one wants to do not how.

Without any doubt :wink:

This isn't quite accurate, but what it does do is what I want: it magnifies to level it was at when you last released ⌃⌥. This is great, because I pretty much always use the same magnification.

However the use of ⌃⌥ is out of the question — I am using very man ⌃⌥ keystrokes for application shortcuts, utility features, and KM macros. So I faked it out:

This isn't quite accurate, but what it does do is what I want: it magnifies to level it was at when you last released ⌃⌥. This is great, because I pretty much always use the same magnification.

However the use of ⌃⌥ is out of the question — I am using very many ⌃⌥ keystrokes for application shortcuts, utility features, and KM macros. So I faked it out:

Not sure yet whether I want to wait for F1 up or Control up.

Not sure what you mean with “isn’t quite accurate”. My description corresponds to what I’m experiencing (macOS El Capitan, still). Just tried it again:

You set up the desired level of magnification once -> then it’s at your ⌃⌥-finger-tips.

But, honestly, I’m loosing tracks of what you wanted to achieve originally :wink:

BTW: Be careful with these ‌ key down <modifier> ‌ AppleScripts. If you forget to ‘up’ the key, your Mac will no longer be your best friend (until you have restarted it) :wink:

1 Like

Word.

LOL, yes, this is really sh… err unpleasant :wink:

You’ve sent an Option-key-down to your Mac via AppleScript … and you are lost. You can’t even type “Help” because it comes out as “Ó´¬π” :wink:

But then the worst thing is: your Mac is still smiling at you. Apparently she (or he) has no clue that something is wrong. But you know the only way out is to kill her, brutally. Your finger is approaching that shutdown button, and she’s still smiling at you. Best to close your eyes when pressing down that button.

LOL. I could have sworn mine stuck its tongue out at me, as if to say “hey, I’m only doing what you told me to!”

Yeah, that’s your Win experience still shining through :wink:

I don't think so... It's my Mac, not my Windows machine. Although I have to admit I do run Windows in Parallels sometimes, and I do allow them to talk to each other, so you might be right! Argh!!!

:slight_smile:

This is completely delusional. Cute macro, but accomplishes nothing.

Sorry, don't know what I was seeing that made me think that.

Your original answer told me exactly what I needed to know. The problem is that since Apple is giving us no way to set the key(s) we want for automatic zoom, enabling automatic zoom screws up all my very many keybindings that include ⌃⌥, so it is basically useless.

The only idea I have left — and maybe someone could come up with something else —would be to leave automatic scrolling off, have some key (e.g., ⌃F1) turn it off, and when released turn it back off. (Probably can't get to that by AppleScript, probably can by GUI scripting, maybe can by ASObjc.)

Maybe on a lower level?

See this:

OS X Text System Keybindings

For testing for modifier keys I use this:

on modifierKeyTest()
  set keyDown to {commandDown:false, optionDown:false, controlDown:false, shiftDown:false}
  set currentModifiers to current application's class "NSEvent"'s modifierFlags()
  tell keyDown
    set its optionDown to (currentModifiers div (get current application's NSAlternateKeyMask) mod 2 is 1)
    set its commandDown to (currentModifiers div (get current application's NSCommandKeyMask) mod 2 is 1)
    set its shiftDown to (currentModifiers div (get current application's NSShiftKeyMask) mod 2 is 1)
    set its controlDown to (currentModifiers div (get current application's NSControlKeyMask) mod 2 is 1)
  end tell
  return keyDown
end modifierKeyTest


In homage to here.