Wow, apparently it's been 4 years since I last posted
So anyway, https://love2d.org/wiki/Joystick:getID this says that the ID stays the same even if i disconnect/reconnect a joystick, but if i unplug one and plug in another, the new one gets the ID of the first. Am I missing something?
Next, I have 4 xbox 360 controllers (wireless) and 1 xbox elite controller (wired/wireless), in linux they all show up fine, but in windows the fifth one (whichever order I plug them in) doesn't show up.
I tried setting the SDL_XINPUT_ENABLED=0 in windows env vars to try and switch to directinput but it doesn't seem to be working with the 5th. I'm not entirely sure I've done it right as I'm assuming it shouldnt list them as Xinput devices if xinput is disabled:
Windows:
Ubuntu:
Cheers!
A few questions about controllers
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
- zorg
- Party member
- Posts: 3465
- Joined: Thu Dec 13, 2012 2:55 pm
- Location: Absurdistan, Hungary
- Contact:
Re: A few questions about controllers
There are 3 types of IDs for controllers;
- An instance ID returned as the second return value from getID;
- The ID returned as the first return value from getID;
- A Globally Unique ID returned from getGUID.
Instance IDs change if you unplug/replug in the controller.
IDs only change when you restart the game.
GUIDs don't change, but they are/may be different per-OS.
I'm not exactly certain which one corresponds to the controller ID listings people like to post all the time, and i'm not sure which one is visible in your screenshots, but the "...if i unplug one and plug in another, the new one gets the ID of the first." thing seems a bit fishy.
- An instance ID returned as the second return value from getID;
- The ID returned as the first return value from getID;
- A Globally Unique ID returned from getGUID.
Instance IDs change if you unplug/replug in the controller.
IDs only change when you restart the game.
GUIDs don't change, but they are/may be different per-OS.
I'm not exactly certain which one corresponds to the controller ID listings people like to post all the time, and i'm not sure which one is visible in your screenshots, but the "...if i unplug one and plug in another, the new one gets the ID of the first." thing seems a bit fishy.
Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
Re: A few questions about controllers
Ahh, forgot to post my code:
So it's the first id, which shouldnt change?
EDIT:
Apparently a restart has fixed the second issue, I've now got all 5 recognised but now they arent gamepads and only have 5 axis!
Code: Select all
function love.draw()
world:Draw()
local joysticks = love.joystick.getJoysticks()
for i, joystick in ipairs(joysticks) do
love.graphics.print(joystick:getName(), 10, i * 20)
love.graphics.print(joystick:getID(), 150, i * 20)
end
end
EDIT:
Apparently a restart has fixed the second issue, I've now got all 5 recognised but now they arent gamepads and only have 5 axis!
Who is online
Users browsing this forum: No registered users and 4 guests