
-----------------------------------
Raknarg
Tue May 31, 2011 5:50 pm

Other possible input devices
-----------------------------------
Is it possible to use other devices other than the keyboard to get an input in Turing? Like for instance, if I had a USB controller, is that allowed?

-----------------------------------
goroyoshi
Tue May 31, 2011 6:41 pm

RE:Other possible input devices
-----------------------------------
i doubt that beause usb controlers are usually set to key input, unless when used in certain pc games
EX: Borderlands PC supports the Xbox 360 controller just plugged in nothing else

-----------------------------------
DemonWasp
Tue May 31, 2011 7:08 pm

RE:Other possible input devices
-----------------------------------
No, there's no easy way to make that happen. Games like Borderlands contain code that (usually) interfaces with something called DirectInput that can accept input from all kinds of controllers -- everything from an xbox360 controller to the old Sidewinders and game pads. Turing has no way to interface with DirectInput, and no way to read from a USB port. Even when you're using Input.KeyDown, you're dealing with an interface made available in Turing, because Turing knows how to request that information from the O/S.

Turing doesn't know how to talk to USB interfaces, DirectInput or even OpenIL (the OpenGL/AL/IL version of DirectInput, roughly). Worse, you can't link Turing against any other language that can do those things, because Turing doesn't support that.

-----------------------------------
Raknarg
Tue May 31, 2011 8:41 pm

RE:Other possible input devices
-----------------------------------
Ok, thanks, just a thought. So then there's other languages that can do that?

-----------------------------------
DemonWasp
Tue May 31, 2011 11:36 pm

RE:Other possible input devices
-----------------------------------
Any language that can talk to DirectInput or OpenIL, no matter how many layers you have to go through, can do it. This includes, but is not limited to: C, C++, Java, C#, Python, Lua, ...

If you really really wanted to, you could write code that talks to a generic USB device using your own protocol. I really don't recommend it if you want to develop a game, but if you want to learn all about USB and talking to separate hardware, then it might be good learning material.

-----------------------------------
chrisbrown
Wed Jun 01, 2011 2:06 am

RE:Other possible input devices
-----------------------------------
There's always Turing's Joystick module for basic functionality. [tdoc]Joystick.GetInfo[/tdoc] can be used in the same fashion as Mouse.Where and should work with most game controllers configured in windows. You're limited to two axes and buttons though.

-----------------------------------
2F_Zelda
Thu Jun 09, 2011 2:42 am

Re: Other possible input devices
-----------------------------------
If your computer has one, a parallel port can easily be used to get inputs. Pins 10-13 and 15 can be read with parallelget. The help file has a nice little section on it.

-----------------------------------
Raknarg
Thu Jun 09, 2011 9:38 am

RE:Other possible input devices
-----------------------------------
Lol, it's fine, I don't intend on trying it soon, I was just wondering if it was possible. Thank you, though.

-----------------------------------
Nick
Thu Jun 09, 2011 4:14 pm

Re: Other possible input devices
-----------------------------------
I know it's possible to use usb controllers in turing because [url=http://compsci.ca/v3/viewtopic.php?t=17192]I made the tutorial and module
