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

Joystick:does not run properly on windows #868

Open
wushu037 opened this issue Oct 18, 2022 · 7 comments
Open

Joystick:does not run properly on windows #868

wushu037 opened this issue Oct 18, 2022 · 7 comments
Labels

Comments

@wushu037
Copy link

wushu037 commented Oct 18, 2022

Thanks a lot for providing the joystick library, it works fine on Mac, but there are exceptions on windows

environment

  • I used the sample code from joystick's readme to run
  • gobot v1.16.0
  • go1.18

compilation warning
joystick relies on go-sdl2, and this warning occurs when it is compiled cross-platform from Mac to Windows and directly on Windows.
image

For this warning. I raised an issue with go-sdl2, and later I replaced it with 0.4.25 as suggested, and the warning disappeared. So maybe joystick should update the version of go-sdl2

running exception
I'm using Xbox Wireless Controller (xsx2020) and it only occasionally listens to the trigger button, but not to all other keys!

I also tried to run scanner.go, but it quits immediately
image

@wushu037 wushu037 changed the title joystick:Compiling and running exceptions Joystick:compiling and running exceptions Oct 18, 2022
@gen2thomas gen2thomas added the bug label Oct 18, 2022
@gen2thomas
Copy link
Collaborator

maybe related to #860

@wushu037
Copy link
Author

maybe related to #860

sorry, don't see the obvious correlation

@gen2thomas
Copy link
Collaborator

Hi @wushu037, currently "github.com/veandco/go-sdl2 v0.3.3" is referenced by go.mod. Your suggestion was to use "0.4.25". Therefor I assumed this means the module version, but maybe I'm wrong.

@wushu037
Copy link
Author

wushu037 commented Oct 20, 2022

Hi @gen2thomas , i read the issue you linked to, maybe I didn't understand it and didn't see any connection to the go-sdl2 module version.
but yes, go-sdl2 needs to be replaced with the latest version in order to compile properly on windows. Also, even if it runs successfully, there are issues to troubleshoot during runtime (see first comment)

@gen2thomas
Copy link
Collaborator

Hi @wushu037 , I have now fixed the old modules on dev branch. I started "go run scanner.go" like you have done, but without any joystick attached and in a Linux box - it do not exit immediately, it waits. Unfortunately I have no windows system to test it.

What do you mean with "it works fine on Mac"? Do you have used the same example? I ask, because the example use a "dualshock3" type. Is this compatible with your "Xbox Wireless Controller (xsx2020)"?

@wushu037
Copy link
Author

wushu037 commented Oct 20, 2022

Hi, @gen2thomas , thank you for your investigation of the problem
Here's the thing. I tested it on Mac and Windows, and it works fine on Mac, but there is an exception on Windows. I didn't test it on Linux

It is the example of the sample. to describe the problem briefly, I do not give my program.. Although the example uses "dualshock3", on Mac, my xsx2020 joystick still has multiple keys that can be listened to. But on Windows, only the trigger key is occasionally listened to

To better solve the problem, I give my program file. It implements a very simple function: mapping the joystick's share keys to the system's share keys. In this program, the configuration file is set up by me running scanner.go on my Mac, and also only the trigger key is responded to.

gamepad-keys-map.zip

If you don't have Windows, you can install a virtual machine and the effect should be the same. Either on a win virtual machine or a win physical machine, I tried

@gen2thomas
Copy link
Collaborator

Hi @wushu037 , I need to stop my support here, because windows and no joystick available.

Please could you change the headline to which is more pointing to the remaining problem, e.g. this words/phrases should be included "windows, scanner.go, only one key". So someone can pick up the issue with existing hardware and deeper knowledge.

@wushu037 wushu037 changed the title Joystick:compiling and running exceptions Joystick:does not run properly on windows Oct 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants