PDA

View Full Version : Mouse, stupid mouse!



IlovePascal
28-08-2006, 08:44 AM
Hello everyone, Iv been making games that are always limited to the keyboard inputs of Free Pascal, and I decided it's time to move on! :D lol

I have tried most of the procedures and functions that the manual describes (to get mouse buttons, check events, show and hide mouse, getx and gety, and to position cursor wherever in the screen) but only some of them worked. The most important ones, getmousex and getmousey did not work and my variables x and y were constantly set to 0. I also noticed that when checking the mouse buttons it only recognised when I pressed the buttons, not when I released them. Would anyone be kind enough to help me solve those problems, please??? I would really appreciate it so that I can make user-friendlier games ;)
Thank you

WILL
28-08-2006, 12:07 PM
Hi ILP,

Yeah joystick and mouse input are really nice to use in some kinds of games. And in a few others completely essential to the genre.

Though you could try to access these devices by raw code, I'd recommend instead trying an already established library that handles most of the tricky stuff for you. Even with the 'hard stuff' done for you, there is much that you may need to code around it to make a nice control interface for your games.

I personally use JEDI-SDL which has a whole ton of game related functionality (graphics, sound, networking, etc) including keyboard, mouse and joystick input handling. But you can of course look for others.

Asphyre, Omega, UnDelphiX and DirectX headers would give you solutions aswell, but they are not cross-platform compatible (DirectInput only) if that is what you're looking for.

Hope this helps. ;)