Please explain how to use joy to me

Started by MisterN, September 25, 2011, 03:55:06 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

MisterN

http://wiki.bennugd.org/index.php?title=Joy_getaxis
http://wiki.bennugd.org/index.php?title=Joy_getbutton

its on the wiki, but theres no examples to show how to use it. how do you use it? like i tried doing if but nothing worked, and by itself it does nothing. could you help? Im testing out bennu so :P. I want to know what this is used for before I try and compile it in KOS for dreamcast.
werg

handsource-dyko

I know it isn't much, but on the main page of the wiki you can find this example: http://wiki.bennugd.org/index.php?title=Tutorial:Joystick_tester.

It wasn't very obvious for me at first too, but it comes down to the fact that you can have several joystick devices (like 4 gamepads for instance), and the number of supported buttons is quite large. The fact that you can have 9 axis is a bit weird, I think this is to support playstation like sixaxis controlllers, but personally I think 2 axis are more then enough. My perspective on josticks/gamepads are the snes standard.

But this standard supports those overly complicated flightsimulator joysticks. This is why it isn't straight foreward. Also systems like the cannoo require very specific buttons to use. I refered to splinter's jkeys.lib for my input system.

MisterN

i copied and pasted it, tested it with my xbox 360 controller, did not work. 3:/
werg

handsource-dyko

That's strage... :-\ It works on my 5 joysick setup (4 nes gamepads with usb converted nes fourscore, and one other usb joystick).
Normally, the first device attached should be device 0. This is a usb/windows thing. On linux the devices are mapped differently. This could be an sdl issue. I don't know. On windows it should simply work. Even on linux it works just fine.

josebita

Quote from: DoctorN on September 25, 2011, 04:59:31 PM
i copied and pasted it, tested it with my xbox 360 controller, did not work. 3:/
Please explain what that means. It didn't compile? Did any error message pop up in the console?

MisterN

the window popped up but it was just a black screen. i decided to put in a sprite that mvoes around and so it did so that means the program didnt crash. but eh.
werg

josebita

Can you post the source code as you're using it?

Also, which OS and bennu version are you using?

MisterN

Copy and paste exactly from the tutorial
bennupack bennu
windows 7 home premium x64

specs are:
1680x945 display
dual core processor
4gb ddr2 ram
nvidia 9200m gd+ 256mb
werg

josebita

(Sorry for answering so late, I'm very busy in real life)
Could you try with a different joystick? I believe I read recently that the Xbox360 controller is handled in a special manner, but maybe I'm just plain wrong...

handsource-dyko

Is the xbox 360 gamepad usb-hid compliant? If that's the case, it should work fine. I use joysticks based on this design: http://www.raphnet.net/electronique/atari_usb/index_en.php and this design: http://www.raphnet.net/electronique/4nes4snes/index_en.php. They are slightly modified, but you can find them on my site: http://dykodesigns.woelmuis.nl/mikaflex-en.html.
They work under windows and linux, without any drivers (hid-compliant).