diff options
author | Anton Khirnov <anton@khirnov.net> | 2022-05-18 14:06:14 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2022-05-18 14:06:14 +0200 |
commit | 647a1cf9b541c31e17a018ec1e9874708d613dca (patch) | |
tree | 94c20ccbe5a5f27ebd589752f8c5d937c8250008 | |
parent | d3d31eadcb4c210aea86698438af4371b9c4febc (diff) |
uinput_mng: implement updating FF effects
-rwxr-xr-x | uinput_mng | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -229,9 +229,15 @@ class PhysDevices(dict): def upload_effect(self, effect): # upload the effect to all currently tracked devices for name, d in self.items(): + # is this a new effect or a change of an existing one + try: + upload_id = self._ff_effect_idmap[name][effect.id] + except LookupError: + upload_id = -1 + effect_d = ff.Effect(type = effect.type, direction = effect.direction, ff_trigger = effect.ff_trigger, - ff_replay = effect.ff_replay, u = effect.u, id = -1) + ff_replay = effect.ff_replay, u = effect.u, id = upload_id) did = d.upload_effect(effect_d) self._ff_effect_idmap[name][effect.id] = did |