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

LPD8 Buttons stay pressed #4

Open
kokoi1 opened this issue Jun 17, 2019 · 8 comments
Open

LPD8 Buttons stay pressed #4

kokoi1 opened this issue Jun 17, 2019 · 8 comments

Comments

@kokoi1
Copy link

kokoi1 commented Jun 17, 2019

First of all thank you very much for this amazing tool.

I mapped my LPD8, and while the knobs are working great as all the axis, the buttons are working ones but then stay stuck as pressed.

The tester give me these values when a button is being pressed:
[[[144, 40, 11, 0], 2588]]
[[[128, 40, 127, 0], 2813]]

I tried to map button 1 as 144 40, but it seems that then the joystick doesn't know that the button is not being pressed anymore (I guess event 128 40).

I hope that I'm just doing something wrong here.

Daniel

@jphustman
Copy link

This is happening to me too. Do you know how to unpress buttons? I'll dig into the code but it might take awhile to figure out!

@litaniast
Copy link

litaniast commented Jan 16, 2020

Same issue on the Rock Band Keyboard. (the keyboard controller for Rock Band 3, but connected via midi)

@caseyAEC
Copy link

Having the same issue with AKM320 keyboard. Mod wheels and Slider working fine, but keypresses stay on when pressed.

@cpyarger
Copy link
Contributor

cpyarger commented Apr 1, 2020

Same with my Xtouch compact

@cpyarger
Copy link
Contributor

cpyarger commented Apr 1, 2020

I just submitted a pull request that fixes this issue

@lareooreal
Copy link

I added a modified version in the issue section with a complete hacked script to adress this problem as a zip file
This should work
Lareooreal

@tanskudaa
Copy link

tanskudaa commented Feb 23, 2021

The problem is here:

elif key[0] == 128:
    # A button off input
    vjoy.SetBtn(reading, opt[0], int(opt[1]))

which sends the reading of the physical button pressed (eg. velocity on piano) for vJoy and vJoy uses this as the state of the virtual button.
But my piano, and I'd guess many other MIDI devices as well, send a default reading of 64 (pushed with half pressure out of the maximum) for every button release message.
If you change the code to send a 0 every time it receives a status 128 (note off on channel 1) it's fixed. You need to specify every note off in the .conf-file though:

midi2vjoy.py:
elif key[0] == 128:
    # A button off input
    vjoy.SetBtn(0, opt[0], int(opt[1]))

example.conf:
# Note on
144     24  1   1

# Note off
128     24  1   1

Thanks for the author of the program. I'm modifying it to use piano chords as gamepad buttons 🌚

@fyyyyy
Copy link

fyyyyy commented Feb 9, 2022

Also need to add 129 and 145 for i.e. Novation Circuit which sends these IDs for the second instrument

		elif key[0] == 128 or key[0] == 129:
                # ...
		elif key[0] == 144 or key[0] == 145:

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

8 participants