Describe what would you like to see added/changed
On modern trucks, like MAN TGX, the gear selector is at the end of the right stalk. On the Moza stalks, the rear wiper selector has a spring pushing the button back. Toggling up would mean "Switch to drive", toggling all the way down would mean "Switch to reverse". Moving from ON to OFF, or the opposite would mean "Switch to Neutral".
Could you help out in any way?
I have already coded something, but once in ETS2, it does not really work as intended... below is the code I produced:
MOZA_WIPERS_GEARBOX = [11, 12, 13]
GEARBOX_STATES = ["neutral", "drive", "reverse"]
def __init__(self):
# ...
self._gearbox_state = ""
self._gearbox_previous = 0
def _gearbox_handler(self, button: int, thread=False) -> None:
if not thread:
Thread(daemon=True, target=self._gearbox_handler, args=[button, True]).start()
return
# Handle switch to Drive/Reverse
if button == MOZA_WIPERS_GEARBOX[2]:
if self._gearbox_state == GEARBOX_STATES[0] or self._gearbox_state == "":
if self._gearbox_previous == MOZA_WIPERS_GEARBOX[1] or self._gearbox_previous == 0:
print("Switch to drive")
self._send_gearbox_button(18)
elif self._gearbox_previous == MOZA_WIPERS_GEARBOX[0] or self._gearbox_previous == 0:
self._gearbox_state = GEARBOX_STATES[2]
print("Switch to reverse")
self._send_gearbox_button(14)
if (button == MOZA_WIPERS_GEARBOX[0] and self._gearbox_state == GEARBOX_STATES[1]) or (button == MOZA_WIPERS_GEARBOX[1] and self._gearbox_state == GEARBOX_STATES[2]):
self._gearbox_state = GEARBOX_STATES[0]
print("Switch to neutral")
self._send_gearbox_button(16)
self._gearbox_previous = button
Describe what would you like to see added/changed
On modern trucks, like MAN TGX, the gear selector is at the end of the right stalk. On the Moza stalks, the rear wiper selector has a spring pushing the button back. Toggling up would mean "Switch to drive", toggling all the way down would mean "Switch to reverse". Moving from ON to OFF, or the opposite would mean "Switch to Neutral".
Could you help out in any way?
I have already coded something, but once in ETS2, it does not really work as intended... below is the code I produced: