Skip to content

Commit 6fae3e4

Browse files
committed
Fix joystick timer
1 parent e0e9a19 commit 6fae3e4

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/m64py/frontend/joystick.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
# You should have received a copy of the GNU General Public License
1818
# along with this program. If not, see <http://www.gnu.org/licenses/>.
1919

20-
from PyQt6.QtCore import QObject, pyqtSignal, QTime, QTimer
20+
from PyQt6.QtCore import QObject, pyqtSignal, QElapsedTimer, QTimer
2121

2222
from sdl2 import SDL_WasInit, SDL_InitSubSystem, SDL_INIT_JOYSTICK
2323
from sdl2 import SDL_JoystickOpen, SDL_JoystickClose, SDL_NumJoysticks, SDL_JoystickNameForIndex
@@ -104,17 +104,17 @@ def open(self, stick=0):
104104

105105
for i in range(self.num_axes):
106106
self.axes[i] = SDL_JoystickGetAxis(self.joystick, i)
107-
self.axis_repeat_timers[i] = QTime()
107+
self.axis_repeat_timers[i] = QElapsedTimer()
108108
self.deadzones[i] = self.joystick_deadzone
109109
self.sensitivities[i] = self.joystick_sensitivity
110110

111111
for i in range(self.num_buttons):
112112
self.buttons[i] = SDL_JoystickGetButton(self.joystick, i)
113-
self.button_repeat_timers[i] = QTime()
113+
self.button_repeat_timers[i] = QElapsedTimer()
114114

115115
for i in range(self.num_hats):
116116
self.hats[i] = SDL_JoystickGetHat(self.joystick, i)
117-
self.hat_repeat_timers[i] = QTime()
117+
self.hat_repeat_timers[i] = QElapsedTimer()
118118

119119
self.clear_events()
120120
self.joystick_timer.start(self.event_timeout)

0 commit comments

Comments
 (0)