Skip to content

Commit

Permalink
Fix the hat handler description and make use of outlow/high parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
landswellsong committed Oct 29, 2024
1 parent d33bb5d commit 61eb3a9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions MAVProxy/modules/mavproxy_joystick/controls.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ def value(self):
class Hat (Control):
'''A Hat maps one axis of a hat as if it were a toggle switch.
When the axis goes negative, the corresponding channel value is
set to `outputlow`. When the axis goes positive, the value is set
to `outputhigh`. No change is made when the axis returns to 0.'''
set to `outlow`. When the axis goes positive, the value is set
to `outhigh`. No change is made when the axis returns to 0.'''

def __init__(self, joystick, id, axis, **kwargs):
super(Hat, self).__init__(joystick, **kwargs)
Expand Down Expand Up @@ -181,7 +181,7 @@ def __init__(self, joystick, controls):
for k in control.keys()
if k in ['outlow', 'outhigh']}

handler = Hat(self.joystick, control['id'], control['axis'])
handler = Hat(self.joystick, control['id'], control['axis'], **kwargs)

elif control['type'] == 'dial':
kwargs = {k: control[k]
Expand Down

0 comments on commit 61eb3a9

Please sign in to comment.