Can scroll direction be changed programmatically?

  • I found a solution using AppleScript[1] but it seems like it may be fragile
    (uses magic numbers, etc).

    Is there another way?

    -Steven

    [1]
    http://apple.stackexchange.com/questions/60877/toggle-natural-scrolling-fro
    m-command-line-with-reload
  • On Thu, May 9, 2013, at 11:55 AM, Steven Degutis wrote:
    > I found a solution using AppleScript[1] but it seems like it may be
    > fragile
    > (uses magic numbers, etc).
    >
    > Is there another way?

    What are you actually trying to accomplish?

    NSEvent has -isDirectionInvertedFromDevice, which can be used to
    override the user's setting when it makes sense. Does that satisfy your
    needs?

    --Kyle Sluder
  • > What are you actually trying to accomplish?

    I often switch between using my rMBP directly, and plugging it into
    this giant monitor. When I'm just using the rMBP's trackpad, I want
    the scroll direction to be natural. But when I'm plugged in and using
    a mouse, I'd prefer it to be unnatural.

    So I'm hoping to find some way of programmatically doing this. Then I
    can plug my solution into my Zephyros config and bind it to a global
    hotkey. This app is super handy.

    It would be even better actually if I could find some notification
    that's triggered when you plug into or unplug from an external
    monitor, then it would automatically toggle this for me.

    I found out that it's the global defaults key
    "com.apple.swipescrolldirection", but I can't figure out how to force
    every open app to notice the new value when I set it. Seems like I'd
    probably have to kill "loginwindow" or something to get the OS to
    register that I changed this. And that seems like a dumb idea.

    -Steven
  • On Thu, May 9, 2013, at 12:13 PM, Steven Degutis wrote:
    >> What are you actually trying to accomplish?
    >
    > I often switch between using my rMBP directly, and plugging it into
    > this giant monitor. When I'm just using the rMBP's trackpad, I want
    > the scroll direction to be natural. But when I'm plugged in and using
    > a mouse, I'd prefer it to be unnatural.

    Ah, yeah, I doubt there's any way other than what you've found.

    But I'd also consider just adopting the "natural" approach. It took me
    about a week to adjust.

    --Kyle Sluder
  • On May 9, 2013, at 1:19 PM, Kyle Sluder wrote:

    > But I'd also consider just adopting the "natural" approach. It took me
    > about a week to adjust.

    FYI, I've never been able to adjust to it when using a mouse at my desk--perfectly fine with it when using the trackpad, but not the mouse...

    --
    Scott Ribe
    <scott_ribe...>
    http://www.elevated-dev.com/
    (303) 722-0567 voice
  • On May 9, 2013, at 14:30:24, Scott Ribe <scott_ribe...> wrote:

    > FYI, I've never been able to adjust to it when using a mouse at my desk--perfectly fine with it when using the trackpad, but not the mouse...

    Apple really needs the scrolling direction to be set on a per-input-device basis. Personally, I hate the "natural" setting, which is only natural on a touchscreen device like an iPad.

    --
    Steve Mills
    office: 952-818-3871
    home: 952-401-6255
    cell: 612-803-6157
  • On 09.05.2013, at 20:55, Steven Degutis <sbdegutis...> wrote:
    > I found a solution using AppleScript[1] but it seems like it may be fragile
    > (uses magic numbers, etc).
    >
    > Is there another way?

    I wonder if an event tap and just changing the direction on each scroll event would work? Could also listen to CGDisplayConfigurationChanged callback in the app that filters the events to see when an external screen is plugged in.

    Cheers,
    -- Uli Kusterer
    "The Witnesses of TeachText are everywhere..."
    http://www.masters-of-the-void.com
  • Kinda like https://github.com/invariant/Scroll-Reverser ? Someone
    showed me this and I glanced at the source code, and was not fond of
    this technique.

    On Thu, May 9, 2013 at 7:26 PM, Uli Kusterer
    <witness.of.teachtext...> wrote:
    > On 09.05.2013, at 20:55, Steven Degutis <sbdegutis...> wrote:
    >> I found a solution using AppleScript[1] but it seems like it may be fragile
    >> (uses magic numbers, etc).
    >>
    >> Is there another way?
    >
    >
    > I wonder if an event tap and just changing the direction on each scroll event would work? Could also listen to CGDisplayConfigurationChanged callback in the app that filters the events to see when an external screen is plugged in.
    >
    > Cheers,
    > -- Uli Kusterer
    > "The Witnesses of TeachText are everywhere..."
    > http://www.masters-of-the-void.com
    >
    >
    >
  • On 10/05/2013, at 5:44 AM, Steve Mills <smills...> wrote:

    > Apple really needs the scrolling direction to be set on a per-input-device basis. Personally, I hate the "natural" setting, which is only natural on a touchscreen device like an iPad.

    Seconded. Lets all file radars...

    --Graham
previous month may 2013 next month
MTWTFSS
    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31    
Go to today