aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2022-05-18 14:06:14 +0200
committerAnton Khirnov <anton@khirnov.net>2022-05-18 14:06:14 +0200
commit647a1cf9b541c31e17a018ec1e9874708d613dca (patch)
tree94c20ccbe5a5f27ebd589752f8c5d937c8250008
parentd3d31eadcb4c210aea86698438af4371b9c4febc (diff)
uinput_mng: implement updating FF effects
-rwxr-xr-xuinput_mng8
1 files changed, 7 insertions, 1 deletions
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