Re: Need Crash Course in Mouse Support

new topic     » goto parent     » topic index » view thread      » older message » newer message

At 10:34 PM 6/10/98 -0400, you wrote:

>I need a crash course in mouse programming in Euphoria.
>
>First in DOS32.  I think I can have the program just look for clicks,
>instead of the move event.  Now, if I display a text on the screen, and my
>event would be the left mouse click on that text.  get_mouse would return
>a three atom sequence:
>
>1.  left-down
>2 & 3 coordinates

to check for the left down event use:

if and_bits(LEFT_DOWN,events[1]) then ....

If you only want to catch clicks and not
movement call:

mouse_events(254)

>The coordinates seem to run into at least a hundred.  What is the
>coordinate system used?  Is it pixels?  If so, I guess I need a crash
>course on that too.

It *should * be pixels, in some graphics modes
DOS erroniously reports x value as double what it should be.


>Then, is mouse programming in WIN32 easier or harder than DOS32?  I don't
>see any Euphoria routines that track mice in WIN32.

*EVERYTHING* is harder in WIN32 (thanks Bill)
Any mouse interaction is handled through the windows API.

here's a quick example:

include graphics.e
include mouse.e

object events

if graphics_mode(19)

while 1 do
    events=get_mouse()
    if sequence(events) then
        if and_bits(LEFT_DOWN,events[1]) then
            puts(1,"\nLeft button was pressed at :")
            ?events[2..3]
            abort(0)
        end if
    end if
end while




Have fun,

Graeme.

----------------------------------------------------

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu