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

Button 9, shift, doesn't on a M$ FFB Pro #15

Open
GoogleCodeExporter opened this issue Mar 21, 2015 · 1 comment
Open

Button 9, shift, doesn't on a M$ FFB Pro #15

GoogleCodeExporter opened this issue Mar 21, 2015 · 1 comment

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. Use the adapter with a M$ Force Feedback Pro joystick in XP and probably any 
other OS
2. Open "Control Panel" -> "Printers and Other Hardware" -> "Game Controllers", 
click "Properties" on the "LUFA Joystick wFFB" and go to the "Test" tab. 
3.  Try using the 9'th button (the shift arrow) and it will trigger by itself 
as button 9, and not shift the other buttons to the remaining stubbed out 
button entries 10-16. 

What is the expected output? What do you see instead?
I expected to button 9 to not trigger a press by itself, but for button 1-8 
pressed in conjunction to read as button 9-16 respectively.

What version of the product are you using? On what operating system?
I'm using the M$ Force Feedback Pro with the adapt-ffb-joy latest svn firmware 
(downloaded 11/08/2014) and installed on a self-made adapter with a teensy 2.0. 

I managed to fix it in the code, but am not sure if it's more than just a hack 
or should be fixed other places.

I changed this line in Joystick.c:
outReportData->Button = ((sw_report[4] & 0x7F) << 2) + ((sw_report[3] & 0xC0) 
>> 6);

to these lines:
        if ((sw_report[4] & 0b01000000) == 0b01000000)
        {
            // button 9 (shift) is held down
            sw_report[4] &= 0b10111111;     // Lift up button 9; it's not to be used alone.
            outReportData->Button = ((sw_report[4] & 0x7F) << 10) + ((sw_report[3] & 0xC0) << 2);
        }
        else
            outReportData->Button = ((sw_report[4] & 0x7F) << 2) + ((sw_report[3] & 0xC0) >> 6);


And it does exactly what I wanted.  I'm a bit surprised and proud of myself 
since I haven't ever edited code to a hardware device before and was successful 
so quickly.  I know I should have applied it in patch format, but as I'm on 
windows right now I don't have diff easily available.  I'm attaching the fully 
modified Joystick.c file.


Thanks if you decide to include this in future releases,

  Lucas

Original issue reported on code.google.com by [email protected] on 7 Mar 2015 at 11:13

Attachments:

@cbhacking
Copy link

One downside of this approach is that you can't use Shift+Hat as a combination (even though some games allow that) because shift by itself isn't a valid button anymore. While there might be games that support 16 buttons but don't support combos, I would expect it to be mostly the other way around.

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

No branches or pull requests

3 participants