3 Attachment(s)
Using Mouse and /or Keyboard instead of a Gamepad with a VB based program.
I've been assigned to figure out a way to use mouse and/or keyboard with a VB based program. Its really a bunch of simple games for the neuropsychology experiments. I am wondering where to start ?
When i first run the program, i get this message about a control JOYSTK.OCX saying, this is an unregistered version of the control, get a registered version from mabry Software... .... blah blah blah ... !! Next, when i hit Esc, this screen goes away for the while.
There are two forms (Intro.frm and Stop.frm) and a module (Inhib.bas). These are attached for everyone's reference.
What i am trying to do is either one or all of the following :
1. Change the gamepad buttons used in the program from 2 and 4 to a more symmetric 6 & 8 or 5 & 7. (The game pad that i have is Impact X6-36uv ver 1.1).
2. Use left and right mouse buttons instead of the game pad buttons.
3. Use the keyboard left and right arrow keys instead of the game pad buttons.
Any comments, suggestions on what i may do are welcome ?
PS: Owing to my background, my knowledge of programming in VB or otherwise is really limited but am willing to try and experiment.
Re: Using Mouse and /or Keyboard instead of a Gamepad with a VB based program.
I would suggest that you delete the existing drivers for the game pad and install some generic gamepad drivers, or just get a new gamepad.
I'm sure your department can stretch to £20 can't it? :)
Re: Using Mouse and /or Keyboard instead of a Gamepad with a VB based program.
You can tell that this code was written by a biologist :D
Goto's and variants as far as the eye can see. It's pretty shocking, you should consider re-writing it from scratch.
Re: Using Mouse and /or Keyboard instead of a Gamepad with a VB based program.
Man ... i knew i am a lousy programmer !!
Building from scratch is of course an option but not an immediate one.
Any suggestions on fixing the existing code will be appreciated.
Re: Using Mouse and /or Keyboard instead of a Gamepad with a VB based program.
Well, selecting approriate data types for all the variables, instead of leaving them typeless. Variants are evil.
Goto's MUST be eradicated at all costs. This can be achieved by good If...End If usage and subrouting structuring.
To be perfectly honest, throw it away and begin from new. Leave nothing to ambiguity, make sure all code is explained and justified.
Then you will end up with a good program that is easy to maintain or modify.