Computer Science Canada

mouse clicking

Author:  skier [ Sun Nov 14, 2004 1:06 pm ]
Post subject:  mouse clicking

i am trying to amke a program so that when you click a botton on the mouse it makes a sound. i have got it working but it only works when you click in side the display window. is there a away to leave the program running but minimized and have it still work?
code:

loop
    var x, y, radius, clr : int
    if Mouse.ButtonMoved ("down") then
        play ("b")      % a sharp in a lower octave
        var buttonnumber, buttonupdown : int
        Mouse.ButtonWait ("down", x, y, buttonnumber,
            buttonupdown)
    end if
end loop

Author:  Delos [ Sun Nov 14, 2004 1:19 pm ]
Post subject: 

Simply Window.Hide() the window.

Oh, and 'b' is not a#, b is cb.

Author:  skier [ Sun Nov 14, 2004 1:33 pm ]
Post subject: 

how do i no what the "window id" is

Author:  Delos [ Sun Nov 14, 2004 5:47 pm ]
Post subject: 

One of two things.

At the beginning of the programme, you can Window.Open() a new window...you'll need a variable for that so that variable will then hold the winID.

Or you can Window.GetActive the winID. Amazing what happens when you press F10!

Author:  skier [ Mon Nov 15, 2004 3:06 pm ]
Post subject: 

then why does this not work.i dont here anything

code:

loop
    Window.Hide (defWinID)
    var x, y : int
    if Mouse.ButtonMoved ("down") then
        play ("b")
        var buttonnumber, buttonupdown : int
        Mouse.ButtonWait ("down", x, y, buttonnumber,
            buttonupdown)
    end if

end loop

Author:  Delos [ Mon Nov 15, 2004 3:20 pm ]
Post subject: 

Try using just Mouse.Where(), it should work a bit better.

BTW, you might want to consider changing that "down" to "downup".

Author:  skier [ Mon Nov 15, 2004 4:10 pm ]
Post subject: 

The mouse.where command works much better thank you for your time


: