Well, I assumed you must be making the scrollbar disappear when the mouse exits, because otherwise the user would be able to click on it without it having any effect, wouldn’t they?
If you just want the bar to stay there but not be clickable, then you don’t need to mess around with hit tests, just call setInterceptsMouseClicks() on it.
Now I’m really confused. Why would I want any of that behavior?
My original intent was to prevent mouse events from triggering while the mouse is on an artificial gap I create via the hitTest function. I didn’t like that the scrollbar had exactly zero pixels between the content and itself, so I wrote this hitTest function so it stops accepting events a bit earlier.
Then I make sure not to paint anything into the last “n” pixels, and voila, I got my visual gap.
Now I added the hover function, so the user can easily see, before clicking, which item would be clicked. It also helps tremendously to visually identify which entry triggered the tooltip and it looks more reactive / modern to boot. Win / win / win.