GML Joystick (Windows and Ubuntu)


I'm trying to get a simple arcade joystick with a few buttons working in a game. I first need it in Windows and later preferably exported to Ubuntu. Windows detecs the joystick just fine and I can trace on a test website.

I've been trying to use joystick_xpos() to trace my joystick in the game, but I get the "unknown function or script..." error line, which makes sense after I found a post saying that the function is obsolete. I cannot find other functions than the ones I also found was claimed to be obsolete.

So how do I trace my joystick in GM2? Do I need to treat it as a gamepad instead?

Thanks in advance,
Alright, so right after typing this, I solved it (tada, typing makes you think). To other people with a similar problem, here's what works (at least for me):

The joystick registeres as a gamepad with the id 4 (and probably 5 for a second joystick). So the following traces horizontal movement from -1 to 1:
gamepad_axis_value(4, gp_axislh);