Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Detecting two keypresses at the same time
#11
Quote:Yay! It works! I'll try it in my program sometime today. This should still work when I compile my program, right?

Oh yeah, is there someway to access a game pad with QBASIC? I figure it uses INP statements, but don't know which port.

You have to know the Port number of your ports.

If you have plugged your gamepad into COM1, for example, do this:

-Right click on "My Computer"
-Goto Device Manager, (in XP it is under the Hardware tab)
-Scroll down to the Ports(COM and LPT) bit
-Open that bit out and doubleclick COM1.
-Click on the "Resources" Tab
-look at the I/O range. Take the first value. It maybe be something like 03F8.
-Take the 0 off the front and add &H. to get something like &H3F8.

There!! that would be the port for your gamepad. You can do the same for other ports as well.
Reply
#12
So, if the port is &H3F8 then INP(&H3F8) would return the data sent by the controller? Or is it a lot more complicated?
nd remember kids, only you can provoke forest fires!
Reply
#13
Most gamepads plug into the gameport (201h), not the serial port. Here's a basic rundown of how to read the joystick/gamepad info.
Reply
#14
Quote:So, if the port is &H3F8 then INP(&H3F8) would return the data sent by the controller? Or is it a lot more complicated?

That is exactly... essentially how you use a port. =)

Although, as Plasma said it depends where your gamepad is plugged into.... also, you would really have to learn well about the messages that your gamepad sends the port inm order to use multiple keys, etc...
Reply
#15
I assume it's like the keyboard: One code for pressing a button, another for releasing it.
nd remember kids, only you can provoke forest fires!
Reply
#16
Yeah, if you aren't using mine, try it! And thanks for the endorsement, Zack. Smile
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)