Getting system scroll direction for InputEventPanGesture

Godot Version

4.3

Question

In both Windows and macOS (and I’m sure Linux) users can change system settings controlling the scroll direction used when scrolling using the mouse wheel and scroll/pan gestures on the track pad. Basically if you want the content to go up or down when you scroll the mouse wheel or pan the track pad up/down.

For the scroll wheel mouse buttons Godot seems to support this by simply switching the buttons around. So if you scroll “up” on the mouse wheel you get an input event with MOUSE_BUTTON_WHEEL_UP button in one case, and if you have your system scroll direction reversed the same “up” on the mouse wheel will generate a MOUSE_BUTTON_WHEEL_DOWN input event.

However, this doesn’t seem to be the case for InputEventPanGesture, where the delta seems to be the same regardless of system scroll direction.

So, is there a way to access what the current OS scroll direction is set to? Godot apparently uses this to switch around the mouse scroll wheel events, so it’s in there somewhere. Or is there some premade way to get a pan gesture scroll delta that compensates for the system scroll direction?