From 647a1cf9b541c31e17a018ec1e9874708d613dca Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Wed, 18 May 2022 14:06:14 +0200 Subject: uinput_mng: implement updating FF effects --- uinput_mng | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/uinput_mng b/uinput_mng index b2e9a7a..2abdbbf 100755 --- a/uinput_mng +++ b/uinput_mng @@ -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 -- cgit v1.2.3