Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Other possible input devices
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Raknarg




PostPosted: Tue May 31, 2011 5:50 pm   Post subject: 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?
Sponsor
Sponsor
Sponsor
sponsor
goroyoshi




PostPosted: Tue May 31, 2011 6:41 pm   Post subject: 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




PostPosted: Tue May 31, 2011 7:08 pm   Post subject: 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




PostPosted: Tue May 31, 2011 8:41 pm   Post subject: RE:Other possible input devices

Ok, thanks, just a thought. So then there's other languages that can do that?
DemonWasp




PostPosted: Tue May 31, 2011 11:36 pm   Post subject: 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




PostPosted: Wed Jun 01, 2011 2:06 am   Post subject: RE:Other possible input devices

There's always Turing's Joystick module for basic functionality. Joystick.GetInfo 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




PostPosted: Thu Jun 09, 2011 2:42 am   Post subject: 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




PostPosted: Thu Jun 09, 2011 9:38 am   Post subject: 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.
Sponsor
Sponsor
Sponsor
sponsor
Nick




PostPosted: Thu Jun 09, 2011 4:14 pm   Post subject: Re: Other possible input devices

I know it's possible to use usb controllers in turing because I made the tutorial and module
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 9 Posts ]
Jump to:   


Style:  
Search: