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

cant save keyboard configuration #2

Closed
axaluss opened this issue Feb 17, 2014 · 30 comments
Closed

cant save keyboard configuration #2

axaluss opened this issue Feb 17, 2014 · 30 comments

Comments

@axaluss
Copy link

axaluss commented Feb 17, 2014

When i change the key bindings in settings>plugins>input>configure they are not saved.
My changes are always reverted to default.

How about a "save as..." button for the input config?

@gen2brain
Copy link
Member

If they are not saved then something is wrong. Are there any errors in log?
You have mode set to "Fully "Manual ?

@axaluss
Copy link
Author

axaluss commented Feb 17, 2014

@gen2brain
Copy link
Member

Ok, you have this error that prevents settings from being saved.

Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/m64py/frontend/settings.py", line 46, in showEvent
self.set_config()
File "/usr/lib/python2.7/dist-packages/m64py/frontend/settings.py", line 93, in set_config
self.set_core()
File "/usr/lib/python2.7/dist-packages/m64py/frontend/settings.py", line 245, in set_core
self.core.config.get_parameter("DelaySI"))
TypeError: QAbstractButton.setChecked(bool): argument 1 has unexpected type 'NoneType'

These are options from latest mupen64plus, you are using old binary, probably from mupen64plus downloads.

Just add these options manually in mupen64plus.cfg in [Core] section:

# Delay interrupt after DMA SI read/write
DelaySI = True
# Force number of cycles per emulated instruction
CountPerOp = 0

@axaluss
Copy link
Author

axaluss commented Feb 17, 2014

I added the lines.
It still does not save.
now i get

 __  __                         __   _  _   ____  _            
|  \/  |_   _ _ __   ___ _ __  / /_ | || | |  _ \| |_   _ ___  
| |\/| | | | | '_ \ / _ \ '_ \| '_ \| || |_| |_) | | | | / __| 
| |  | | |_| | |_) |  __/ | | | (_) |__   _|  __/| | |_| \__ \ 
|_|  |_|\__,_| .__/ \___|_| |_|\___/   |_| |_|   |_|\__,_|___/ 
             |_|                                               

M64Py - A frontend for Mupen64Plus version 0.2.0

Frontend: INFO: attached to library 'Mupen64Plus Core' version 1.99.5
Frontend: INFO: includes support for Dynamic Recompiler.
Frontend: INFO: includes support for MIPS r4300 Debugger.
Frontend: INFO: video extension enabled
Input: N64 Controller #1: Forcing default keyboard configuration
Input: Using auto-configuration for device 'Keyboard'
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/m64py/frontend/input.py", line 57, in closeEvent
    self.save_config()
  File "/usr/lib/python2.7/dist-packages/m64py/frontend/input.py", line 122, in save_config
    self.save_opts()
  File "/usr/lib/python2.7/dist-packages/m64py/frontend/input.py", line 233, in save_opts
    widget.itemData(widget.currentIndex()))
  File "/usr/lib/python2.7/dist-packages/m64py/core/config.py", line 140, in set_parameter
    param_value = C.byref(param_ctype(param_value))
TypeError: an integer is required

@Nohac
Copy link

Nohac commented Mar 8, 2014

I'm having the same problems, I fixed it by editing the config file manually and then set the file to read only.

 __  __                         __   _  _   ____  _            
|  \/  |_   _ _ __   ___ _ __  / /_ | || | |  _ \| |_   _ ___  
| |\/| | | | | '_ \ / _ \ '_ \| '_ \| || |_| |_) | | | | / __| 
| |  | | |_| | |_) |  __/ | | | (_) |__   _|  __/| | |_| \__ \ 
|_|  |_|\__,_| .__/ \___|_| |_|\___/   |_| |_|   |_|\__,_|___/ 
             |_|                                               

M64Py - A frontend for Mupen64Plus version 0.2.0

Frontend: INFO: ScreenSaver not available: org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.ScreenSaver was not provided by any .service files
ldd: warning: you do not have execution permission for `/usr/lib/libmupen64plus.so.2.0.0'
Frontend: INFO: attached to library 'Mupen64Plus Core' version 2.0.0
Frontend: INFO: includes support for Dynamic Recompiler.
Frontend: INFO: video extension enabled
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/m64py/frontend/settings.py", line 46, in showEvent
    self.set_config()
  File "/usr/lib/python2.7/site-packages/m64py/frontend/settings.py", line 93, in set_config
    self.set_core()
  File "/usr/lib/python2.7/site-packages/m64py/frontend/settings.py", line 245, in set_core
    self.core.config.get_parameter("DelaySI"))
TypeError: QAbstractButton.setChecked(bool): argument 1 has unexpected type 'NoneType'
´´´

@gen2brain
Copy link
Member

New version is released and this should be fixed now. Please check.
Thanks

@ghost
Copy link

ghost commented Oct 11, 2014

@axaluss @shindoku Please test this release

@MrBluewoods
Copy link

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.

@ghost
Copy link

ghost commented Oct 15, 2014

@MrBluewoods what mupen64plus version are you using. Because this behavior sounds like the old 1.99.x

@MrBluewoods
Copy link

@fayvel I am using Mupoen64plus 2.0.0 with M64py 0.2.1.

@ghost
Copy link

ghost commented Oct 17, 2014

@MrBluewoods can you please show me the output of following two commands

id
stat ~/.config/mupen64plus/mupen64plus.cfg

And please upload your config ~/.config/mupen64plus/mupen64plus.cfg somewhere (pastebin) and link it here.

Cool would also if you could start m64py inside the terminal, try to modify the input settings and then post the stuff m64py wrote to the terminal

@ghost
Copy link

ghost commented Oct 18, 2014

Just hint to myself: SDL_GetScancodeFromName seems to be misused inside the input.py because it cannot parse stuff like "button(4)" and will always return 0

@rz5
Copy link

rz5 commented Oct 19, 2014

The same is happening to me with a USB gamepad.
Setting the controls while Mode is "Fully Manual" and pressing Close does not save. Directly editing "%appdata%\Mupen64Plus\mupen64plus.cfg" makes it work as intended.

Windows 7 32-bit
M64Py Version: 0.2.2
Mupen64Plus core version: 2.0.0

@sprockkets
Copy link

Hey guys, I'm not sure if m64py is to blame or not. No matter what I choose to use for manual or auto config, it still messes up.
If you want to really control how mupen64plus configures your controller, read this:
http://code.google.com/p/mupen64plus/wiki/ControllerSetup

This is how I fixed it for me using a xbox360 controller (or a clone of it).

@Mushman
Copy link

Mushman commented Nov 10, 2014

I also experience this issue with an official Xbox 360 wired USB controller. I was able to use @rz5's solution as a workaround. I have used both M64Py 0.2.1 and 0.2.2 with Mupen64Plus 2.0.0.

@deathpancake
Copy link

The same thing happened to me, I had to manually edit the .cfg file as well. Quite an oversight!

@Korvox
Copy link

Korvox commented Jun 21, 2015

So I'm having this issue as well, running master on Arch. I think I'm getting a bug of a different variety though, because in my case...

File "mupen64plus-ui-python/src/m64py/frontend/input.py", line 420, in get_sdl_key
    key = QKeySequence(text).__int__()
NameError: name 'QKeySequence' is not defined

Which is just an obvious missing

from PyQt5.QtGui import QKeySequence

If I add that to the top though...

key = QKeySequence(text).__int__()
AttributeError: 'QKeySequence' object has no attribute '__int__'

Next line needs an int code for the key to pass to a converter to SDL2's keycodes, and never having touched pyqt before trying to find documentation on this was a lost cause for me. The general Qt methods don't provide a way to generate integral key codes from sequences in the primary docs, though.

I'm gonna assume that code is almost never invoked, and if I just pass --sdl2 to m64py I take the main codepath and can assign most keys again, but strangely assigning "Shift" isn't working while other modifiers like ctrl and alt are. I'm curious if its a syntax error somewhere. So I just printed out the text being passed into the get_sdl_key function and saw... oddities.

Retur&n
Retur&n
,
,
.
.
Le&ft
Le&ft
L&eft
L&eft
&Right
&Right
&Up
&Up
D&own
D&own

Looks like mnemonic codes to me, and they seem to be in the SDL keycodes? Some keys I can reassign and some I cannot. ctrl, space, and up work. Left and shift do not. But I digress here, maybe this info will help with this bug, I recognize the rabbit hole into learning way too much about pyqt and the sdl2 bindings for Python all weekend when I see it. I've already ended up spending a week debugging SDL2's pulseaudio support!

... I just wanted to rebind my keys and play some Banjo! ;x

@slimjim27
Copy link

hey just figured id ask um im needing help trying to get my usb controller to work on m64py its got a messed up joystick so i can only use one (the rightstick) so i use it for n64 emus specifically how do i get m64py to save my manual controller configuration?

@illuminati7
Copy link

Does anyone know where the config file would be stored on OS X El Capitan? I'm trying to help a friend but I never used OS X

@chaimaa-kadaoui
Copy link

@illuminati7 According to this site: https://conchurnavid.github.io/docs/KeyboardSetup.html, the config file should be here:
~/.config/mupen64plus/mupen64plus.cfg

@soreau
Copy link
Contributor

soreau commented Apr 20, 2016

@MrBluewoods

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.

I had this problem and managed to fix it with this:

diff --git a/src/m64py/frontend/input.py b/src/m64py/frontend/input.py
index f1765e6..b71e218 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):

soreau added a commit to soreau/mupen64plus-ui-python that referenced this issue Apr 20, 2016
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 mupen64plus#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."
@inukaze
Copy link

inukaze commented Oct 4, 2016

I can't change the default keyboard values . i am writring the follow to the config, and dont work :

[Input-SDL-Control1]

# Mupen64Plus SDL Input Plugin config parameter version number.  Please don't change this version number.
version = 2,000000
# Controller configuration mode: 0=Fully Manual, 1=Auto with named SDL Device, 2=Fully automatic
mode = 0
# Specifies which joystick is bound to this controller: -1=No joystick, 0 or more= SDL Joystick number
device = -1
# SDL joystick name (or Keyboard)
name = "Keyboard"
# Specifies whether this controller is 'plugged in' to the simulated N64
plugged = True
# Specifies which type of expansion pak is in the controller: 1=None, 2=Mem pak, 5=Rumble pak
plugin = 2
# If True, then mouse buttons may be used with this controller
mouse = False
# Scaling factor for mouse movements.  For X, Y axes.
MouseSensitivity = "2,00,2,00"
# The minimum absolute value of the SDL analog joystick axis to move the N64 controller axis value from 0.  For X, Y axes.
AnalogDeadzone = "4096,4096"
# An absolute value of the SDL joystick axis >= AnalogPeak will saturate the N64 controller axis value (at 80).  For X, Y axes. For each axis, this must be greater than the corresponding AnalogDeadzone value
AnalogPeak = "32768,32768"
# Digital button configuration mappings
DPad R = "key(275)"
DPad L = "key(276)"
DPad D = "key(274)"
DPad U = "key(273)"
Start = "key(13)"
Z Trig = "key(104)"
B Button = "key(116)"
A Button = "key(103)"
C Button R = "key(108)"
C Button L = "key(106)"
C Button D = "key(107)"
C Button U = "key(105)"
R Trig = "key(101)"
L Trig = "key(113)"
Mempak switch = "key(44)"
Rumblepak switch = "key(46)"
# Analog axis configuration mappings
X Axis = "key(97,100)"
Y Axis = "key(119,115)"

I dont know why , i set like the above , but works like from below :

A Button = "key(304)"
Z Trig = "key(122)"
B Button = "key(306)"

For example. someone can help me to fix it. i compile manually the source code from git

@richard42
Copy link
Member

gen2brain, shouldn't this issue be closed?

inukaze, are you using the M64Py front-end application?

@inukaze
Copy link

inukaze commented Oct 9, 2016

Richard42 yes the python ui stuck the main window if you wanna see I can record it

@gen2brain
Copy link
Member

I thought this is fixed and only new release was missing. I will test again, currently I don't have any joystick, I wil try it probably for weekend.

@inukaze
Copy link

inukaze commented Oct 10, 2016

The CLI UI don't save neither is complete ignored the keyboard
configuration on ~/.config/mupen64plus/mupen64plus.cfg

Just take the values from file InputAutoCfg.ini

Not from the user configuration

El 10/10/2016 9:20, "Milan Nikolic" notifications@github.com escribió:

I thought this is fixed and only new release was missing. I will test
again, currently I don't have any joystick, I wil try it probably for
weekend.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#2 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABki5LiwvaqMv-0zKbt2s2GocCjnVYSfks5qyjuagaJpZM4BihDG
.

@gen2brain
Copy link
Member

gen2brain commented Oct 10, 2016

And what do you have in config for controller configuration mode?

Controller configuration mode: 0=Fully Manual, 1=Auto with named SDL Device, 2=Fully automatic

mode = 0

@inukaze
Copy link

inukaze commented Oct 10, 2016

Ok i had the follow inside my file ~/.config/mupen64plus/mupen64plus :

[Input-SDL-Control1]

Mupen64Plus SDL Input Plugin config parameter version number. Please

don't change this version number.
version = 2

Controller configuration mode: 0=Fully Manual, 1=Auto with named SDL

Device, 2=Fully automatic
mode = 0

Specifies which joystick is bound to this controller: -1=No joystick, 0

or more= SDL Joystick number
device = -1

SDL joystick name (or Keyboard)

name = "Keyboard"

Specifies whether this controller is 'plugged in' to the simulated N64

plugged = True

Specifies which type of expansion pak is in the controller: 1=None, 2=Mem

pak, 5=Rumble pak
plugin = 2

If True, then mouse buttons may be used with this controller

mouse = False

Scaling factor for mouse movements. For X, Y axes.

MouseSensitivity = "2.00,2.00"

The minimum absolute value of the SDL analog joystick axis to move the

N64 controller axis value from 0. For X, Y axes.
AnalogDeadzone = "1710,1710"

An absolute value of the SDL joystick axis >= AnalogPeak will saturate

the N64 controller axis value (at 80). For X, Y axes. For each axis, this
must be greater than the corresponding AnalogDeadzone value
AnalogPeak = "15708,15708"

Digital button configuration mappings

DPad R = "key(275)"
DPad L = "key(276)"
DPad D = "key(274)"
DPad U = "key(273)"
Start = "key(13)"
Z Trig = "key(104)"
B Button = "key(116)"
A Button = "key(103)"
C Button R = "key(108)"
C Button L = "key(106)"
C Button D = "key(107)"
C Button U = "key(105)"
R Trig = "key(101)"
L Trig = "key(113)"
Mempak switch = "key(44)"
Rumblepak switch = "key(46)"
X Axis = "key(97,100)"
Y Axis = "key(119,115)"

But the keys working are diferent, the mapping working is :

[Keyboard]
plugged = True
plugin = 2
mouse = False
AnalogDeadzone = "4096,4096"
AnalogPeak = "32768,32768"
DPad R = "key(100)"
DPad L = "key(97)"
DPad D = "key(115)"
DPad U = "key(119)""
Start = "key(13)"
Z Trig = "key(122)"
B Button = "key(306)"
A Button = "key(304)"
C Button R = "key(108)"
C Button L = "key(106)"
C Button D = "key(107)"
C Button U = "key(105)"
R Trig = "key(99)"
L Trig = "key(120)"
Mempak switch = "key(44)"
Rumblepak switch = "key(46)"
X Axis = "key(276,275)"
Y Axis = "key(273,274)"

And you can see is diferent configuration. i must edit the InputAutoCfg.ini
to put my configuration working i wait.

2016-10-10 9:52 GMT-04:00 Milan Nikolic notifications@github.com:

And what do you have in config for controller configuration mode?
Controller configuration mode: 0=Fully Manual, 1=Auto with named SDL
Device, 2=Fully automatic

mode = 0


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#2 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABki5OHc8A9dkxCTyw3esgYG83kV4tzNks5qykMngaJpZM4BihDG
.

@rz5
Copy link

rz5 commented Oct 12, 2016

To whom it may concern:

Since mupen64plus lacks a GUI, I resorted to this project. I noticed this GUI had some issues with saving the config file and came here to reconfirm the bug.

From that point, I searched for other GUIs and found RetroArch. There is a libretro version of mupen64 and I got the hang of using it through RA. Plus, the extra libretro features got me to stick with it till this day (been about 2 years since I posted in here).

@gen2brain
Copy link
Member

Fixed.

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