Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 788903e

Browse files
committed
Input device configuration working
1 parent 0cc2e7c commit 788903e

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

lib/cfclient/ui/dialogs/inputconfigdialogue.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ def showConfigBox(self, caption, message, directions=[]):
176176
self.box.show()
177177

178178
def startConfigOfInputDevice(self):
179-
self.joystickReader.enableRawReading(self.inputDeviceSelector.currentIndex())
179+
self.joystickReader.enableRawReading(str(self.inputDeviceSelector.currentText()))
180180
self.rawinputreader.startReading()
181181
self.populateDropDown()
182182
self.profileCombo.setEnabled(True)
@@ -448,5 +448,7 @@ def startReading(self):
448448
@pyqtSlot()
449449
def read_input(self):
450450
[rawaxis, rawbuttons] = self.joystickReader.readRawValues()
451+
#logger.info("AX: {}".format(rawaxis))
452+
#logger.info("BT: {}".format(rawbuttons))
451453
self.rawAxisUpdateSignal.emit(rawaxis)
452454
self.rawButtonUpdateSignal.emit(rawbuttons)

lib/cfclient/utils/input.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ def getAvailableDevices(self):
181181

182182
return approved_devs
183183

184-
def enableRawReading(self, deviceId):
184+
def enableRawReading(self, device_name):
185185
"""
186186
Enable raw reading of the input device with id deviceId. This is used
187187
to get raw values for setting up of input devices. Values are read
@@ -191,7 +191,7 @@ def enableRawReading(self, deviceId):
191191
self._input_device.close()
192192

193193
for d in readers.devices():
194-
if d.id == deviceId:
194+
if d.name == device_name:
195195
self._input_device = d
196196

197197
# Set the mapping to None to get raw values

0 commit comments

Comments
 (0)