Results 1 to 7 of 7

Thread: user defined mouse event handler wanted!

  1. #1

    user defined mouse event handler wanted!

    Hi all,, :?:

    I was going to send you a private message M109uk , but decided that there may be others out here that would also appreciate this info..

    You posted an excellent keyboard event handler to my other query, maybe you will respond here

    It would be very handy to have a user defined mouse event handler ,
    (for Delphi 5).......

    allllllll righteeeeeeee then .. ato
    The Universe is all right here!!!

  2. #2

    user defined mouse event handler wanted!

    A bit more...

    If one uses a normal form mousedown procedure for mouse events,
    and then enters a repeat or while loop.. Whilst within the loop any mousedown action does not register...
    How can you register a mouse down event whilst within such a loop...

    eg...
    --------------------------------------------
    enter this procedure loop with a form mouse down action

    procedure
    repeat
    do something
    check for left mouse button
    // how ??as form mousedown action does not register...!!
    until leftmouse button
    exit procedure

    -------------------------------------------------
    its a pretty simple task but implementing it is not obvious ....

    I have tried setting Globals from the form mouse down , but these globals do not update whilst within the looping procedure ...

    cheeeeeerrrrsssssssss ato
    The Universe is all right here!!!

  3. #3

    user defined mouse event handler wanted!

    Use DirectInput
    Ask me about the xcess game development kit

  4. #4

    user defined mouse event handler wanted!

    HI Harry...

    hmmmmm, yes well I can solve the problem using DXInput,,,

    OK... I now know that DirectInput is part of the ExcessGameDev kit

    So, I will finally install it and try it out.... as I have got most of DelphiX under my belt........

    Though for interest,,, Surely there is method to implement this in standard Delphi 5.. as well!!!!!
    Its a pretty common type of situation ..

    Remember I am a novice at Delphi programming....

    Little by little, progress is made...

    Cheeeeeeerrrrrrrssssssss ato
    The Universe is all right here!!!

  5. #5
    Legendary Member cairnswm's Avatar
    Join Date
    Nov 2002
    Location
    Randburg, South Africa
    Posts
    1,537

    user defined mouse event handler wanted!

    The key is not to lock the program in a loop like that. Especially in a game as the screen rendering will be locked out of the loop as well.

    Take a look at TheLion's templates in the tutorial section on how to use the OnIdle to do your refreshes.

    If you move the loop counter into a global/form variable then you can use the same loop type structure within the OnIdle event handler without impacting the normal Windows events.
    William Cairns
    My Games: http://www.cairnsgames.co.za (Currently very inactive)
    MyOnline Games: http://TheGameDeveloper.co.za (Currently very inactive)

  6. #6

    user defined mouse event handler wanted!

    Hi William...

    THX for the response...

    But for my particular situation, I have found the simple solution..

    All One has to do is use

    Application.ProcessMessages; // within the loop

    (I knew it had to be easy !!).
    ============================


    "The key is not to lock the program in a loop like that. Especially in a game as the screen rendering will be locked out of the loop as well. "

    In my case, I am updating the screen within the loop..
    ----------------------------------

    "Take a look at TheLion's templates in the tutorial section on how to use the OnIdle to do your refreshes. "

    I don't have The lions templates , but I do have info on the OnIdle ..
    -------------------------------

    cheeeeeeeeeerrrrrrrssssssssss..................ato
    The Universe is all right here!!!

  7. #7

    user defined mouse event handler wanted!

    Hi Alll....

    Just thought I'd let the other novices know that one can get left and right mouse button info,, using the same functions that are listed in
    Pause/ resume and fonts ( this forum)...

    kindly supplied by M109UK

    All you need to do is use

    If IsKeyDown(VK_LBUTTON) Then // do somethiong

    or If IsKeyDown(VK_RBUTTON)


    the VK codes are very handy....
    so that's the end of that..

    cheeeeeeeeerrrrrrrrrrrrssssssssss ato
    The Universe is all right here!!!

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
  •