Skip to content

Commit 862c411

Browse files
authored
Merge pull request gvalkov#128 from odormond/master
Fix set_absinfo to allow setting parameters to zero
2 parents 9aead89 + fb3f9e8 commit 862c411

2 files changed

Lines changed: 12 additions & 6 deletions

File tree

docs/changelog.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
Changelog
22
---------
33

4+
Master
5+
====================
6+
7+
- Fix ``InputDevice.set_absinfo`` to allow setting parameters to zero.
8+
9+
410
1.3.0 (Jan 12, 2020)
511
====================
612

evdev/device.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -435,10 +435,10 @@ def set_absinfo(self, axis_num, value=None, min=None, max=None, fuzz=None, flat=
435435
'''
436436

437437
cur_absinfo = self.absinfo(axis_num)
438-
new_absinfo = AbsInfo(value if value else cur_absinfo.value,
439-
min if min else cur_absinfo.min,
440-
max if max else cur_absinfo.max,
441-
fuzz if fuzz else cur_absinfo.fuzz,
442-
flat if flat else cur_absinfo.flat,
443-
resolution if resolution else cur_absinfo.resolution)
438+
new_absinfo = AbsInfo(value if value is not None else cur_absinfo.value,
439+
min if min is not None else cur_absinfo.min,
440+
max if max is not None else cur_absinfo.max,
441+
fuzz if fuzz is not None else cur_absinfo.fuzz,
442+
flat if flat is not None else cur_absinfo.flat,
443+
resolution if resolution is not None else cur_absinfo.resolution)
444444
_input.ioctl_EVIOCSABS(self.fd, axis_num, new_absinfo)

0 commit comments

Comments
 (0)