Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Input configuration issues #48

Closed
brianvanderburg2 opened this issue May 10, 2015 · 7 comments
Closed

Input configuration issues #48

brianvanderburg2 opened this issue May 10, 2015 · 7 comments

Comments

@brianvanderburg2
Copy link

I've been having this issue since 0.1.6, where when I edit the input configuration and close the program, it never seems to actually save and always reverts to something else. With the 0.2.3 version, I am getting an error from Python3:

Traceback (most recent call last):
  File "/usr/share/m64py/m64py/frontend/input.py", line 61, in closeEvent
    self.save_config()
  File "/usr/share/m64py/m64py/frontend/input.py", line 135, in save_config
    self.save_opts()
  File "/usr/share/m64py/m64py/frontend/input.py", line 243, in save_opts
    self.config.set_parameter("name", devicename.encode())
AttributeError: 'bytes' object has no attribute 'encode'

I am using Debian Jessie (recently Debian Wheezy) x64 Linux 3.16 and Mupen64Plus 2.0.0

@brianvanderburg2
Copy link
Author

I have found that by changing the following file I can get it to work:

/usr/share/m64py/m64py/frontend/input.py:

    def save_opts(self):
        devicename = self.device_map.get(self.device)
        if devicename:
            if not isinstance(devicename, bytes):
                devicename = devicename.encode()

            self.config.set_parameter("name", devicename)

The reason is, it seems, sometimes the device name is in bytes already. When I configure the input, I get the following two devices:

Keyboard/Mouse
Joystick 0 (b'DragonRise Inc. Generic USB Joystick ')

So it seems like, when I set it to Keyboard/Mouse, the result from self.device_map.get is not in bytes, but when I set it to use the USB gamepad, the result from self.device_map.get is in bytes and calling encode throws the exception. The change makes it only call encode if it is not already in bytes.

@brianvanderburg2
Copy link
Author

It is still not saving the input configuration correctly. The problem seems to be located somewhere within get_sdl_key. It seems like it is returning 0 for all inputs. I can make the configuration use any key during editing of input (hat, button, axis, or key). It seems to save any type of input for the analog stick configuration. For the other inputs, it only seems to save them if they are keys.

@ghost
Copy link

ghost commented May 10, 2015

This is a duplicate of bug #2

@secretrobotron
Copy link

This does actually help the input library write to the config file. However, mupen64plus still re-writes config, and changes only some of the gamepad mapping.

@slimjim27
Copy link

heres my dilema i cant seem to find the folder /usr/share/mupen64plus and i know i downloaded and installed mupen64plus from gdeb pack instllr. now to clarify, what does show up is my m64py folder. is it possible to do it from this folder and if so ill need a run through.

im using lubutu trusty thar, fully updated, hp compaq with celeron d 3.5ghz processor a 250 gb hdd with another 160 gb hdd attached by sata 2gb ddr3 vram cards sony graphic card

@Mazamazine
Copy link

Mazamazine commented Sep 3, 2016

Same problem here with a fresh ubuntu 16.4
brianvanderburg2 solution coupled with soreau's solution here solved the problem. Modifying directly mupen64plus.cfg didn't work as it was overwritten... (I saw people solving that by editing InputAutoCfg.ini but my controllers was already listed in it.)

@gen2brain
Copy link
Member

It should be fixed in new release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants