![]() |
EventClass used with multiple joysticks
Hi there.
I have been struggling to make multiple events with multiple joysticks but it seems the last event always supersedes the previous ones. I have used EventClass to do, taken as an example the EventHandlingClass tutorial, but I am obviously doing something wrong. My code is as follows: Code:
class Joystick(viz.EventClass): Code:
j2 = Interaction.Joystick(somewindow1) |
Can you post the code for your callback functions? Within the callback functions, are you checking that the event was generated for the correct joystick object (e.joy is self.joystick)?
|
Truth is I wasn't doing that, but why should this matter since the EventClass instance of each Interaction object has it's own callbacks? Isn't this the purpose of EventClass after all, to be able to assign different callback functions for the same event?
For future reference of anyone visiting this thread, putting the following check at the beginning of each callback function fixed the problem: Code:
if e.joy != self.joystick: |
All times are GMT -7. The time now is 12:19 PM. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC