1
0
mirror of https://github.com/lutris/lutris synced 2024-07-08 11:35:50 +00:00

Remove unused joy2key support

This commit is contained in:
Mathieu Comandon 2017-05-29 19:59:57 -07:00
parent 8e7802b74b
commit 06565d8428
2 changed files with 4 additions and 24 deletions

View File

@ -151,7 +151,7 @@ Here's what to expect from the future versions of lutris:
private storage, allowing you to reinstall them on all your devices)
* Game saves sync
* Community features (friends list, chat, multiplayer game scheduling)
* Controller configuration GUI (with xboxdrv / joy2key support)
* Controller configuration GUI (with xboxdrv support)
Come with us!
=============

View File

@ -326,33 +326,13 @@ class Game(object):
self.game_thread.set_stop_command(self.runner.stop)
self.game_thread.start()
self.state = self.STATE_RUNNING
if 'joy2key' in gameplay_info:
self.joy2key(gameplay_info['joy2key'])
# xboxdrv setup
xboxdrv_config = system_config.get('xboxdrv')
if xboxdrv_config:
self.xboxdrv_start(xboxdrv_config)
self.heartbeat = GLib.timeout_add(HEARTBEAT_DELAY, self.beat)
def joy2key(self, config):
"""Run a joy2key thread."""
if not system.find_executable('joy2key'):
logger.error("joy2key is not installed")
return
win = "grep %s" % config['window']
if 'notwindow' in config:
win += ' | grep -v %s' % config['notwindow']
wid = "xwininfo -root -tree | %s | awk '{print $1}'" % win
buttons = config['buttons']
axis = "Left Right Up Down"
rcfile = os.path.expanduser("~/.joy2keyrc")
rc_option = '-rcfile %s' % rcfile if os.path.exists(rcfile) else ''
command = "sleep 5 "
command += "&& joy2key $(%s) -X %s -buttons %s -axis %s" % (
wid, rc_option, buttons, axis
)
joy2key_thread = LutrisThread(command)
self.game_thread.attach_thread(joy2key_thread)
joy2key_thread.start()
self.heartbeat = GLib.timeout_add(HEARTBEAT_DELAY, self.beat)
def xboxdrv_start(self, config):
command = [