From 6fe186e09db01a4beeb4eff03ddcdb80c98706f1 Mon Sep 17 00:00:00 2001 From: Scott Moreau Date: Wed, 20 Apr 2016 12:59:38 -0600 Subject: [PATCH] Assign input values from button widget text After assigning values with a joystick in the input plugin configuration window, none of the joystick values were written to the config file because the code assumed the value to be a key and wrote the parameter only if the key value was successfully decoded. This sets the button parameters from the widget text if the value could not be decoded as an sdl key and fixes the problem mentioned in issue #2 regarding joysticks: "I just installed and tried the latest release and I can confirm that it still occurs, but only for USB controller inputs. That is: It will save my settings if I assign keyboard keys to the N64 controller buttons, but not if I assign USB controller buttons to N64 controller buttons. Those will revert to their previous values as soon as I close the input configuration window." --- src/m64py/frontend/input.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/m64py/frontend/input.py b/src/m64py/frontend/input.py index f1765e6..6f363af 100644 --- a/src/m64py/frontend/input.py +++ b/src/m64py/frontend/input.py @@ -328,6 +328,7 @@ class Input(QDialog, Ui_InputDialog): v = "key(%s)" % value self.config.set_parameter(key, v.encode()) else: + self.config.set_parameter(key, widget.text().encode()) continue def get_axis(self, axis):