MattJeanes / Joystick-Module

A joystick module for GMod, originally by NightEagle.
13 stars 14 forks source link

Added e2 functions that use the net library for sending joystick data. #4

Closed thegrb93 closed 4 years ago

thegrb93 commented 9 years ago

Here's a library I made for using joysticks with e2. Still beta and not thoroughly bug tested. Here's a rundown on the functions.

void joystickRefresh() --Resends joystick information to the server. Use this if you unplug/plug new controllers.
void joystickSetActive(enum, on) --Starts or stops streaming of owner's joystick/button updates to the server. Enum is the joystick number, on is whether to start or stop the stream.
void entity:joystickSetActive(enum, on) --Same as above except use on a vehicle to automatically start/stop joystick stream of anyone who uses the vehicle.
number entity:joystickCount() --Returns number of joysticks a player has
string entity:joystickName(enum) -- Returns the name of a joystick a player has
number entity:joystickAxisCount(enum) -- Returns the number of axis a player's joystick has
number entity:joystickButtonCount(enum) -- Returns the number of buttons a player's joystick has
number entity:joystickPOVCount(enum) -- Returns the number of POVs a player's joystick has.
array entity:joystickAxisData(enum) -- Gets an array of the axis positions of a player's joystick.
array entity:joystickButtonData(enum) -- Gets an array of button states of a player's joystick.
array entity:joystickPOVData(enum) -- Gets an array of POV positions of a player's joystick.
MattJeanes commented 7 years ago

Hey man, sorry for the amazingly long response times I've only just seen this somehow. Hopefully you're still alive. I'm going to take a look at these changes in the next few years days and merge it in and update the addon! Thanks for your contribution 😄

thegrb93 commented 7 years ago

Haven't used this in forever since I've moved from e2 to starfall (it supports this module as well), but I don't think any gmod updates should have affected it.

brandonsturgeon commented 5 years ago

@MattJeanes maybe you shouldn't have been so hasty to cross out the "years" in your comment ;)

MattJeanes commented 5 years ago

Oops.. 🤣

thegrb93 commented 5 years ago

People should use the module with starfall instead anyway since it is a lot better than E2.

MattJeanes commented 4 years ago

I'm just gonna go ahead and merge this 😅 it's optional new functionality so shouldn't break anything existing, people can raise issues if they run into problems I've had a read through the code looks very reasonable! Better late than never..right?