Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Elements do not update when underlying view is scrolled #3

Closed
mjrusso opened this issue Jan 1, 2022 · 2 comments
Closed

Elements do not update when underlying view is scrolled #3

mjrusso opened this issue Jan 1, 2022 · 2 comments

Comments

@mjrusso
Copy link
Owner

mjrusso commented Jan 1, 2022

If the focused window in the frontmost app has a scroll view, and you pull up Scoot (in element-based nav mode), and then start scrolling, the regions that Scoot has drawn won't update.

There are (at least) two ways to scroll:

  • using Scoot's keyboard shortcuts for scrolling, or
  • using your physical mouse or trackpad)

For the latter case, are there any accessibility-related hooks in MacOS to detect if the user is scrolling?

Originally posted by @mjrusso in #1 (comment)

@mjrusso
Copy link
Owner Author

mjrusso commented Jan 1, 2022

I did some (very quick) research, and it looks like https://github.com/pilotmoon/Scroll-Reverser might use some of the Carbon hooks we need to detect scrolling. (Note to self: take a closer look at https://github.com/pilotmoon/Scroll-Reverser/blob/master/MouseTap.m)

@mjrusso
Copy link
Owner Author

mjrusso commented Jan 25, 2022

This code is enough to know when the user scrolled:

NSEvent.addGlobalMonitorForEvents(matching: .scrollWheel) { _ in
  print("global mouse scroll")
}

Can also listen for local events, but this is less relevant for this particular use case:

NSEvent.addLocalMonitorForEvents(matching: [.scrollWheel]) { event in
  print("local mouse scroll")
  return event
}

For the global monitor in particular, for system performance reasons, we'll want to make sure that it is only registered while element-based nav is actually active.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant