fixed bug where all gamepad configs from gui were to gamepad4

This commit is contained in:
punkrockguy318 2009-03-17 04:52:29 +00:00
parent c9e2b938cb
commit 4c877572af
2 changed files with 7 additions and 6 deletions

View File

@ -16,7 +16,7 @@ except ImportError:
class KeyGrabber:
""" 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.joystick.init()
if pygame.joystick.get_count() > 0:

View File

@ -558,11 +558,7 @@ class GfceuxApp:
def gamepad_clicked_new(self, widget, data=None):
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
@ -597,6 +593,11 @@ class GfceuxApp:
cp.writeKey(d[widget.name], key_tuple[1])
"""
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
self.launch(command, True)