2

I'm using a JFrame in Java, and was wondering if it was possible to detect when a user in OS X used the trackpad in a horizontal scrolling or zoom gesture. I'm making something that looks similar to Audacity, and navigation could be much more fluid if the user could use those trackpad features rather than the arrow keys!

mdierker
  • 502
  • 2
  • 11

1 Answers1

0

You most likely will not have direct access to hardware/platform dependent stuff in plain old Java... Take a look at the two answers on Java trackpad 2-finger scroll listener

Community
  • 1
  • 1
XiaoChuan Yu
  • 3,951
  • 1
  • 32
  • 44
  • I looked at that before -- It uses a clever workaround for horizontal scrolling with the shift button (so it's not really a workaround at all, but it's what I'll wind up doing!), but to the best of my knowledge, a MouseWheelListener can't actually detect a horizontal scroll which is why I wanted to check! – mdierker Mar 05 '12 at 18:45
  • You can have access to the MacOS trackpad events, see my answer at https://stackoverflow.com/questions/48535595/what-replaces-gestureutilities-in-java-9 – Hamish258 Feb 05 '22 at 20:21