Results 1 to 5 of 5

Thread: Using Mouse and /or Keyboard instead of a Gamepad with a VB based program.

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2005
    Posts
    2

    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.
    Attached Files Attached Files

  2. #2
    type Woss is new Grumpy; wossname's Avatar
    Join Date
    Aug 2002
    Location
    #!/bin/bash
    Posts
    5,682

    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?
    I don't live here any more.

  3. #3
    type Woss is new Grumpy; wossname's Avatar
    Join Date
    Aug 2002
    Location
    #!/bin/bash
    Posts
    5,682

    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

    Goto's and variants as far as the eye can see. It's pretty shocking, you should consider re-writing it from scratch.
    I don't live here any more.

  4. #4

    Thread Starter
    New Member
    Join Date
    Oct 2005
    Posts
    2

    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.

  5. #5
    type Woss is new Grumpy; wossname's Avatar
    Join Date
    Aug 2002
    Location
    #!/bin/bash
    Posts
    5,682

    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.
    I don't live here any more.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width