Skip to content

Commit 6fe186e

Browse files
committed
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."
1 parent 010b279 commit 6fe186e

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/m64py/frontend/input.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,7 @@ def save_keys(self):
328328
v = "key(%s)" % value
329329
self.config.set_parameter(key, v.encode())
330330
else:
331+
self.config.set_parameter(key, widget.text().encode())
331332
continue
332333

333334
def get_axis(self, axis):

0 commit comments

Comments
 (0)