Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 mouse clicking
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
skier




PostPosted: 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
Sponsor
Sponsor
Sponsor
sponsor
Delos




PostPosted: Sun Nov 14, 2004 1:19 pm   Post subject: (No subject)

Simply Window.Hide() the window.

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




PostPosted: Sun Nov 14, 2004 1:33 pm   Post subject: (No subject)

how do i no what the "window id" is
Delos




PostPosted: Sun Nov 14, 2004 5:47 pm   Post subject: (No 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!
skier




PostPosted: Mon Nov 15, 2004 3:06 pm   Post subject: (No 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
Delos




PostPosted: Mon Nov 15, 2004 3:20 pm   Post subject: (No subject)

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

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




PostPosted: Mon Nov 15, 2004 4:10 pm   Post subject: (No subject)

The mouse.where command works much better thank you for your time
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 7 Posts ]
Jump to:   


Style:  
Search: