fixed bug where all gamepad configs from gui were to gamepad4
This commit is contained in:
parent
c9e2b938cb
commit
4c877572af
|
@ -16,7 +16,7 @@ except ImportError:
|
||||||
|
|
||||||
class KeyGrabber:
|
class KeyGrabber:
|
||||||
""" KeyGrabber is a wrapper that gets an SDL key from the user using pygame """
|
""" KeyGrabber is a wrapper that gets an SDL key from the user using pygame """
|
||||||
def __init__(self, width=300, height=100):
|
def __init__(self, width=800, height=100):
|
||||||
pygame.init()
|
pygame.init()
|
||||||
pygame.joystick.init()
|
pygame.joystick.init()
|
||||||
if pygame.joystick.get_count() > 0:
|
if pygame.joystick.get_count() > 0:
|
||||||
|
|
11
src/main.py
11
src/main.py
|
@ -558,11 +558,7 @@ class GfceuxApp:
|
||||||
def gamepad_clicked_new(self, widget, data=None):
|
def gamepad_clicked_new(self, widget, data=None):
|
||||||
widgets.get_object("gamepad_config_window").show_all()
|
widgets.get_object("gamepad_config_window").show_all()
|
||||||
|
|
||||||
d = {'gp1_button' : "0",
|
|
||||||
'gp2_button' : "1",
|
|
||||||
'gp3_button' : "2",
|
|
||||||
'gp4_button' : "3"}
|
|
||||||
self.gamepad_config_no = d[widget.name]
|
|
||||||
|
|
||||||
"""
|
"""
|
||||||
#Disabled for now
|
#Disabled for now
|
||||||
|
@ -597,6 +593,11 @@ class GfceuxApp:
|
||||||
cp.writeKey(d[widget.name], key_tuple[1])
|
cp.writeKey(d[widget.name], key_tuple[1])
|
||||||
"""
|
"""
|
||||||
def gamepad_clicked(self, widget, data=None):
|
def gamepad_clicked(self, widget, data=None):
|
||||||
|
d = {'gp1_button' : "1",
|
||||||
|
'gp2_button' : "2",
|
||||||
|
'gp3_button' : "3",
|
||||||
|
'gp4_button' : "4"}
|
||||||
|
self.gamepad_config_no = d[widget.name]
|
||||||
command = '--inputcfg gamepad' + self.gamepad_config_no
|
command = '--inputcfg gamepad' + self.gamepad_config_no
|
||||||
self.launch(command, True)
|
self.launch(command, True)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue