PS2 Joypad problem
Blitz3D Forums/Blitz3D Beginners Area/PS2 Joypad problem
| ||
I'm hoping someone can help me here. I just got a PS2 to USB joystick converter. It installed fine and all buttons etc.. seem to be working after checking in the control panel. I'm trying to get Blitz to recognise any of the joypad buttons but if only seems to pick up that I'm pressing the button for a split second even though I'm holding it down!? The analogue commands are working a treat but is there something I'm doing wrong. I've tried joydown(), joyhit etc.. but getting nowhere. |
| ||
Hmmm. Are you flushing it? That could be your problem...but it's just a guess. Can we see the test code you're using? M |
| ||
USB interfacing is not going to behave in the same manner that a hardwired gameport is going to behave. You are faced with the fact that USB is a shared interface, and as such, the use of it prevents any one device from monopolizing it - which holding a specific position and keeping that input applied would do. What you are possibly dealing with is that the converter is pulsing its input from the joystick out as a single event. And that is what the system sees. A different device driver or converter might send a series of such pulses to emulate a constant input. It would still allow the joystick to be held down, but also permit other devices to work via the USB port, although possibly at a slower rate, But the fact is, I don't believe that a joystick is a suitable device to try to attach via USB. You need a dedicated port, and that just is not USB's nature. I would look for an extention cable to attach your joystick to and go that route. |
| ||
Stevie, it might be your driver has correct DirectInput support but is falling over on the system joystick support. You may want to try playing with the undocumented EnableDirectInput true/false command. Also you are using JoyDown() yes? |
| ||
@Oldefoxx: you might not want to be so presumptuous.... Basically the way old game ports worked is that the joystick itself kept a constant signal going as you described, but hardware on the other side of the port (internal) made values available. You just polled the hardware for new values. Now with USB, there's hardware on the input device itself that sends out values across the USB connection. So the USB port only recieves changes. The hardware is powered by the USB connection itself. Take your mouse for example, every time you move it, the change in value is sent over USB. When you constantly move your mouse around in circles, you don't think of this as your mouse monopolizing your connection do you? :) Joypads only send data over USB when something changes, like your analog stick, it's the equivalent of sending mouse updates. This is the reason you don't see joypads with old school joypad connection to usb adapters, different technology, where as keyboards always worked that way, key codes were sent when you pressed or released a key, so it was easy to make keyboard PS2-USB adapters. @Stevie G: So you tried the simple example in the docs I assume? :/ Not sure what the problem could be... SetBuffer BackBuffer() While Not KeyHit(1) Cls Locate 1, 1 For t = 1 To 4 If JoyDown(t) button$ = "ON" Else button$ = "OFF" EndIf Print "Button " + t + " is " + button$ Next Flip Wend That should quickly show you what buttons are being held down. When you said the pad was working great itself, then you've checked in the game controller control panel and used the button tests there and made sure the lights stay lit when you hold the buttons down? Sorry if I was no help at all, I was mainly replying to suggest a different point of view to Oldefoxx. ;) |
| ||
Thanks for the responses on this one. Been busy so didn't get a chance to post before now. I'm not sure what I did but both PS2 joypads which I have connected to the USB are working a treat now. |