Thank you for reply.
Sorry, still not work with the second joystick
The following is my full project, anyidea how to make that?? thank you very much
drive.google.com
Got it, I've gotten it to partially work but not fully, I can tell you the direction to go into to try and get it working.
That function device_mouse relates to the number of touches occurring:
mouse_x(0)
will only register when
at least touch is happening
mouse_x(1)
will only register when
at least two touches are happening
This means that you can't simply assign 0 and 1 independently like I initially thought. This means you need to come up with a system where when you click on one joystick, say the left one, the left one is reading from device(0) and then when you hold down the right one, it reads from device(1). But then if you let go of the left one, the right one now needs to be reading from device(0) instead. Then when the left is re held down, it needs to be reading from device[1]
This reverses when the right is pressed down first. Its not simply a matter of assigning slot 0 to left and 1 to right but having them able to swap numbers on the fly
I suggest creating a controller object that handles the inputs. Have it keep track of a variable called "available_slot" or something to that effect and have each joystick object check that variable to determine which slot it should be referencing for the mouse_x and y. So if available_slot is 0 that means as soon as a joystick presses down, its active slot becomes 0, then increments the available slot counter by 1. That way when the other joysticks presses down, it now pulls 1 as its active slot...then increments by 1.
Lastly, in the controller object when any device_mouse_released is triggered, -1 from both joysticks active slot. This means that they will go negative which is fine. Use -1 to mean the joystick is not active and make sure to move your joystick pointdirection...etc... code inside the if move code. Var move should only be true if active_slot >= 0, not -1
This is the conclusion I came to while at work...didn't get it completely working but I'm pretty sure this is the way to handle it.