Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > Game Programming > DirectX > Most reliable way to handle keyboard input?


Reply
 
Thread Tools Display Modes
  #1  
Old 01-23-2004, 03:57 AM
munsie munsie is offline
Centurion
 
Join Date: Jan 2004
Posts: 159
Default Most reliable way to handle keyboard input?


I've been using DirectX 7 Direct Input for keyboard polling, but for some reason every once in a while when I run the program the keys are NOT recongnized. I have to re-start VB and then run the app again and all is fine.

I'm considering switching over to GetAsyncKeyState for all of my keyboard handling. I've used this reliably in the past. Is there any benefit to using Direct Input over the GetAsyncKeyState api?

Also, could the GetAsyncKeyState api AND DirectX Input for Joystick reading work at the same time? Thanks...
Reply With Quote
  #2  
Old 01-24-2004, 07:03 AM
joon joon is offline
Centurion
 
Join Date: Mar 2003
Posts: 115
Default

You could use DirectInput from directX. This is a mediocore to good way of handling keyboard inputs. Takes a lot of work, but is more or less reliable!

http://www.directx4vb.com/ has a tutorial on it
Reply With Quote
  #3  
Old 01-25-2004, 10:05 PM
munsie munsie is offline
Centurion
 
Join Date: Jan 2004
Posts: 159
Default

"I've been using DirectX 7 Direct Input for keyboard polling, but for some .... "
Reply With Quote
  #4  
Old 01-26-2004, 02:17 AM
joon joon is offline
Centurion
 
Join Date: Mar 2003
Posts: 115
Default

Sowwy... then I can't help you
Reply With Quote
  #5  
Old 01-26-2004, 10:43 AM
munsie munsie is offline
Centurion
 
Join Date: Jan 2004
Posts: 159
Default

Quote:
Originally Posted by joon
Sowwy... then I can't help you



Hey Joon, no prob. The "problem" seems to only happen in the editor, it hasn't happened to any exe I've made. So, perhaps it's not that big of a deal. Plus after a few uh.. "crashes" I have to reboot VB because everything kind of breaks down.
Reply With Quote
  #6  
Old 01-26-2004, 07:13 PM
JimCamel's Avatar
JimCamel JimCamel is offline
Mostly Absent

* Expert *
 
Join Date: Jun 2002
Location: Christchurch, New Zealand
Posts: 2,006
Default

Sounds like you might have a memory leak or something. Are you making sure to set all your objects = Nothing and unload everything when you're done?
__________________
Sometimes it happens feelings die, Whole years are lost in the blink of an eye
We once had it all but event conspired, Sometimes
Now that it's over, it is through, It gets me everytime I think of you
Sometimes It happens, feelings die, Sometimes
Reply With Quote
  #7  
Old 01-27-2004, 05:14 AM
munsie munsie is offline
Centurion
 
Join Date: Jan 2004
Posts: 159
Default

Quote:
Originally Posted by JimCamel
Sounds like you might have a memory leak or something. Are you making sure to set all your objects = Nothing and unload everything when you're done?



Yep. Thanks for asking, as that is a good point. I've been modifying my engine by the hour, the more I update, the better everything is working and the less overall problems. The keyboard problem hasn't happened for quite a while so I'm going to stick with DI for the keyboard.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
input past eof anthonylmin General 2 06-18-2003 09:13 PM
Getting keyboard input oz1cz Word, PowerPoint, Outlook, and Other Office Products 0 05-23-2003 09:19 AM
Makin a nice little program! Decontain Communications 3 04-11-2003 02:54 AM
opening arrays from files kwijibo General 14 07-22-2002 05:47 PM
How can I ignore keyboard input? Kamochan Game Programming 4 03-19-2002 07:52 PM

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->