本文整理汇总了Python中cfclient.utils.input.JoystickReader.stopInput方法的典型用法代码示例。如果您正苦于以下问题:Python JoystickReader.stopInput方法的具体用法?Python JoystickReader.stopInput怎么用?Python JoystickReader.stopInput使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cfclient.utils.input.JoystickReader
的用法示例。
在下文中一共展示了JoystickReader.stopInput方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: MainUI
# 需要导入模块: from cfclient.utils.input import JoystickReader [as 别名]
# 或者: from cfclient.utils.input.JoystickReader import stopInput [as 别名]
#.........这里部分代码省略.........
if (self.isActiveWindow()):
warningCaption = "Communication failure"
error = "Connection lost to %s: %s" % (linkURI, msg)
QMessageBox.critical(self,warningCaption, error)
self.setUIState(UIState.DISCONNECTED, linkURI)
def connectionFailed(self, linkURI, error):
msg = "Failed to connect on %s: %s" % (linkURI, error)
warningCaption = "Communication failure"
QMessageBox.critical(self,warningCaption, msg)
self.setUIState(UIState.DISCONNECTED, linkURI)
def closeEvent(self, event):
self.hide()
self.cf.close_link()
Config().save_file()
def connectButtonClicked(self):
if (self.uiState == UIState.CONNECTED):
self.cf.close_link()
elif (self.uiState == UIState.CONNECTING):
self.cf.close_link()
self.setUIState(UIState.DISCONNECTED)
else:
self.connectDialogue.show()
def inputDeviceError(self, error):
self.cf.close_link()
QMessageBox.critical(self,"Input device error", error)
def _inputdevice_selected(self, checked):
if (not checked):
return
self.joystickReader.stopInput()
sender = self.sender()
self._current_input_device = sender.text()
device_config_mapping = Config().get("device_config_mapping")
if (self._current_input_device in device_config_mapping.keys()):
self._current_input_config = device_config_mapping[
str(self._current_input_device)]
else:
self._current_input_config = self._menu_mappings.actions()[0].text()
Config().set("input_device", str(self._current_input_device))
for c in self._menu_mappings.actions():
if (c.text() == self._current_input_config):
c.setChecked(True)
self.joystickReader.startInput(str(sender.text()),
self._current_input_config)
self._statusbar_label.setText("Using [%s] with config [%s]" % (
self._current_input_device,
self._current_input_config))
def _inputconfig_selected(self, checked):
if (not checked):
return
sender = self.sender()
self._current_input_config = sender.text()
Config().get("device_config_mapping")[str(self._current_input_device)] = str(self._current_input_config)
self.joystickReader.startInput(str(self._current_input_device),
self._current_input_config)
self._statusbar_label.setText("Using [%s] with config [%s]" % (
self._current_input_device,
self._current_input_config))