Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Keyboard as game controller

Status
Not open for further replies.

AMiSM

Technical User
Joined
Jan 26, 2006
Messages
128
Location
US
Hi!
How can Perl detect the state of individual keys? I've looked in the Win32 API, for use with the WIN32::API module, but I can't get it to work under XP. Is there an issue similar to the parallel port thing?
 
I'd be thinking that Term::ReadKey is ideal for your needs in a console environment.

Paul
------------------------------------
Spend an hour a week on CPAN, helps cure all known programming ailments ;-)
 
I think I can work with that. Thanks, man! :)
 
The arrow keys don't seem to return anything printable, and nothing but zero using the 'ord' function. Is there any way to remedy this?
 
Win32::GUITest might be what you're after

eg/keypress.pl

Paul
------------------------------------
Spend an hour a week on CPAN, helps cure all known programming ailments ;-)
 
I think Term::ReadKey might be more convenient for what I'm doing presently. I'll just use the keypad for arrows. GuiTest would be useful for other things I'd like to do though.

Thank you! :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top