Results 1 to 2 of 2

Thread: Mouse, stupid mouse!

  1. #1

    Mouse, stupid mouse!

    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! 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

  2. #2
    Co-Founder / PGD Elder WILL's Avatar
    Join Date
    Apr 2003
    Location
    Canada
    Posts
    6,107
    Blog Entries
    25

    Mouse, stupid mouse!

    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.
    Jason McMillen
    Pascal Game Development
    Co-Founder





Bookmarks

Posting Permissions

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