Re: MouseDown on Enter
On 01/01/2019 20:39, Alex Tweedly via use-livecode wrote: However - I'm not sure that's a very intuitive UI ("release to play"), so I'd probably go the extra mile and do the harder one that replicates the original UI. And that *is* harder, so I will try it out before I say any more about it ... OK, here's a simple script that does what (I think) you want. NB - I decided to let Malte do the hard work and used AnimationEngine to check whether the mouse was within each hexagon; since Malte very generously put AE into the public domain, I see no reason to struggle through the maths again :-) The following script goes into the card script; you MUST also put a copy of the mouseStillDown handler into each hexagon's script. (Note there is no actual dependence on them being hexagons). -- card script for hexagons on mouseDown setCurrentHex end mouseDown on mouseUp setCurrentHex end mouseUp on mouseRelease setCurrentHex end mouseRelease on mouseStillDown pButtonNumber setcurrentHex end mouseStillDown command setcurrentHex local temp, tCtl, txy, x, y put the mouseLoc into txy set the itemdel to comma put item 1 of tXY into x put item 2 of txy into y repeat with i = 1 to 2 put the points of grc ("P") into temp if pointInPoly(x,y,temp) then put i && the millisecs after msg exit repeat end if end repeat end setcurrentHex btw - you can eliminate the mouseDown, mouseUp and mouseRelease handlers, if you can accept the very short delay until mouseStillDown kicks in. Alex. ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: MouseDown on Enter
Correction: you need to include more ways to turn off the dragging control: local sColor local sDragging on mouseDown put the cColor of the mouseControl into sColor set the backcolor of the mouseControl to sColor put true into sDragging end mouseDown on mouseUp put the cColor of the mouseControl into sColor put false into sDragging end mouseUp on mouseMove x,y if sDragging then get x,y -- force to variable set the backcolor of controlAtLoc(it) to sColor end if end mouseMove on mouseRelease put false into sDragging end mouseRelease on mouseLeave put false into sDragging end mouseLeave On 1/1/19 3:41 PM, J. Landman Gay via use-livecode wrote: On 1/1/19 9:23 AM, Richmond via use-livecode wrote: 1. When one performs a mouseDown on each hexagon a tone is played. 2. While the mouse button is held down the tone continues to sound. 3. If the mouse is dragged (while being pressed) from one hexagon to the next, the sound changes from that of the initial hexagon to the new one. So . . . there would seem to be something "there" that is a bit difficult to implement in LiveCode. Is this what you want? It requires that each hexagon has a custom property named "cColor" that contains an RGB value or a colorname. The script goes into a group or card, and manages all hexagons. local sColor local sDragging on mouseDown put the cColor of the mouseControl into sColor set the backcolor of the mouseControl to sColor put true into sDragging end mouseDown on mouseUp put the cColor of the mouseControl into sColor put false into sDragging end mouseUp on mouseMove x,y if sDragging then get x,y -- force to a variable set the backcolor of controlAtLoc(it) to sColor end if end mouseMove If the card has more objects than just the hexagons, you'll want to test the mouseControl so nothing happens with other objects. Or alternatly, group only the hexagons and put the script into the group. -- Jacqueline Landman Gay | jac...@hyperactivesw.com HyperActive Software | http://www.hyperactivesw.com ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: MouseDown on Enter
On 1/1/19 9:23 AM, Richmond via use-livecode wrote: 1. When one performs a mouseDown on each hexagon a tone is played. 2. While the mouse button is held down the tone continues to sound. 3. If the mouse is dragged (while being pressed) from one hexagon to the next, the sound changes from that of the initial hexagon to the new one. So . . . there would seem to be something "there" that is a bit difficult to implement in LiveCode. Is this what you want? It requires that each hexagon has a custom property named "cColor" that contains an RGB value or a colorname. The script goes into a group or card, and manages all hexagons. local sColor local sDragging on mouseDown put the cColor of the mouseControl into sColor set the backcolor of the mouseControl to sColor put true into sDragging end mouseDown on mouseUp put the cColor of the mouseControl into sColor put false into sDragging end mouseUp on mouseMove x,y if sDragging then get x,y -- force to a variable set the backcolor of controlAtLoc(it) to sColor end if end mouseMove If the card has more objects than just the hexagons, you'll want to test the mouseControl so nothing happens with other objects. Or alternatly, group only the hexagons and put the script into the group. -- Jacqueline Landman Gay | jac...@hyperactivesw.com HyperActive Software | http://www.hyperactivesw.com ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: MouseDown on Enter
First I would consider whether you want *exactly* that UI, or whether something very similar would do. If similar is OK, then I would invert the logic of the UI: - if the mouse (pointer) is over a hexagon, and the mouse is not being pressed - play that note, and keep playing it - if mouse moves into another hex, change note - when the mouse is pressed - and for as long as it stays pressed - play nothing. That is very easy to do (at least, without testing it :,) : each hexagon has handlers that do : on mouseenter -- do whatever it is you do to play a note (??) end mouseenter on mouseup -- do whatever it is you do to play a note (??) end mouseup on mouseleave -- stop playing the current note end mouseleave (actually, probably easier to do single handlers, which check "the target" to determine which hex is being entered/left). Note that whne you move form one to another, it's and the card/group has a handler on mousedown -- stop playing the current note end mousedown and that, I think, should be all you need.. However - I'm not sure that's a very intuitive UI ("release to play"), so I'd probably go the extra mile and do the harder one that replicates the original UI. And that *is* harder, so I will try it out before I say any more about it ... On 01/01/2019 15:23, Richmond via use-livecode wrote: OK, OK; let's be direct and to the point: I want to "rip off" the functionality of this web-page: http://terpstrakeyboard.com/about/ Click on the "Play It Now!" menu item and follow through . . . You will end up with a microtonal keyboard that has this functionality: 1. When one performs a mouseDown on each hexagon a tone is played. 2. While the mouse button is held down the tone continues to sound. 3. If the mouse is dragged (while being pressed) from one hexagon to the next, the sound changes from that of the initial hexagon to the new one. So . . . there would seem to be something "there" that is a bit difficult to implement in LiveCode. I have 2 adjacent hexagons, called "h1" and "h2" containing these scripts, respectively: ... Dragging one's mouse while it is "down" from "h1" to H2" does not turn "h2" yellow! *THIS* is the functionality I am looking for. Right - won\t work because H2 never gets a mouseEnter or mouseDown because the mouse was already down when it moved into H2. I will have a play later tonight and see what I can come up with Alex. Richmond. On 29.12.18 18:52, J. Landman Gay via use-livecode wrote: MouseDown is a message, not a function. You need: if the mouse is down then set the...etc. -- Jacqueline Landman Gay | jac...@hyperactivesw.com HyperActive Software | http://www.hyperactivesw.com On December 29, 2018 9:07:37 AM Richmond via use-livecode wrote: This does *NOT* work: on mouseEnter if mouseDown then set the backgroundColor of me to red else set the backgroundColor of me to green end if end mouseEnter on mouseLeave set the backgroundColor of me to white end mouseLeave which is a "right pox" Richmond. On 29.12.18 16:45, Richmond wrote: This may rank as one of the goofiest questions I've ever asked: Oh, well, here goes: Imagine a mosaic of faux buttons if you will. Each of these buttons will play a tone if I drag my mouse into it: on mouseEnter play audioClip "x.aiff" end mouseEnter All well and good . . . BUT, Richmond wants more . . . I want to get different results from a simple mouseEnter and a mouseEnter while the left-click button is down. Richmond. ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: MouseDown on Enter
PRESUMABLY because there was NOT an object being DRAGGED. *Ru Paul* and All! I don't want to DRAG an object: all I want to do is drag the mouse into the object. On 1.01.19 19:48, Richmond wrote: With the left mouse button depressed I dragged into the graphic "h3" that contained this script: ondragEnter setthebackgroundColorofmetogreen enddragEnter and *NOTHING* happened. On 1.01.19 19:20, Paul Dupuis via use-livecode wrote: You may need to look at LiveCode's drag events since that is the mouse action you are trying to address, namely dragging from one hexagon to another. See the dictionary for events like dragStart, dragEnter, dragLeave, dragStop, etc. ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: MouseDown on Enter
With the left mouse button depressed I dragged into the graphic "h3" that contained this script: ondragEnter setthebackgroundColorofmetogreen enddragEnter and *NOTHING* happened. On 1.01.19 19:20, Paul Dupuis via use-livecode wrote: You may need to look at LiveCode's drag events since that is the mouse action you are trying to address, namely dragging from one hexagon to another. See the dictionary for events like dragStart, dragEnter, dragLeave, dragStop, etc. ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: MouseDown on Enter
Well, of course, one can mess around with "is within", except that my poisonous mind starts worrying about hexagons when LiveCode seems better at understanding rectangles. Richmond. On 1.01.19 19:20, Paul Dupuis via use-livecode wrote: You may need to look at LiveCode's drag events since that is the mouse action you are trying to address, namely dragging from one hexagon to another. See the dictionary for events like dragStart, dragEnter, dragLeave, dragStop, etc. ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: MouseDown on Enter
Now there's a thought! Thanks. Richmond. On 1.01.19 19:20, Paul Dupuis via use-livecode wrote: You may need to look at LiveCode's drag events since that is the mouse action you are trying to address, namely dragging from one hexagon to another. See the dictionary for events like dragStart, dragEnter, dragLeave, dragStop, etc. ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: MouseDown on Enter
You may need to look at LiveCode's drag events since that is the mouse action you are trying to address, namely dragging from one hexagon to another. See the dictionary for events like dragStart, dragEnter, dragLeave, dragStop, etc. ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: MouseDown on Enter
OK, OK; let's be direct and to the point: I want to "rip off" the functionality of this web-page: http://terpstrakeyboard.com/about/ Click on the "Play It Now!" menu item and follow through . . . You will end up with a microtonal keyboard that has this functionality: 1. When one performs a mouseDown on each hexagon a tone is played. 2. While the mouse button is held down the tone continues to sound. 3. If the mouse is dragged (while being pressed) from one hexagon to the next, the sound changes from that of the initial hexagon to the new one. So . . . there would seem to be something "there" that is a bit difficult to implement in LiveCode. I have 2 adjacent hexagons, called "h1" and "h2" containing these scripts, respectively: onmouseDown setthebackgroundColorofmetored endmouseDown onmouseStillDown setthebackgroundColorofmetogreen endmouseStillDown onmouseLeave setthebackgroundColorofmetowhite endmouseLeave - onmouseDown setthebackgroundColorofmetoblue endmouseDown onmouseStillDown setthebackgroundColorofmetoyellow endmouseStillDown onmouseLeave setthebackgroundColorofmetowhite endmouseLeave Dragging one's mouse while it is "down" from "h1" to H2" does not turn "h2" yellow! *THIS* is the functionality I am looking for. Richmond. On 29.12.18 18:52, J. Landman Gay via use-livecode wrote: MouseDown is a message, not a function. You need: if the mouse is down then set the...etc. -- Jacqueline Landman Gay | jac...@hyperactivesw.com HyperActive Software | http://www.hyperactivesw.com On December 29, 2018 9:07:37 AM Richmond via use-livecode wrote: This does *NOT* work: on mouseEnter if mouseDown then set the backgroundColor of me to red else set the backgroundColor of me to green end if end mouseEnter on mouseLeave set the backgroundColor of me to white end mouseLeave which is a "right pox" Richmond. On 29.12.18 16:45, Richmond wrote: This may rank as one of the goofiest questions I've ever asked: Oh, well, here goes: Imagine a mosaic of faux buttons if you will. Each of these buttons will play a tone if I drag my mouse into it: on mouseEnter play audioClip "x.aiff" end mouseEnter All well and good . . . BUT, Richmond wants more . . . I want to get different results from a simple mouseEnter and a mouseEnter while the left-click button is down. Richmond. ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: MouseDown on Enter
Ah, Yes . . . Thanks so much. Richmond. On 29.12.18 18:52, J. Landman Gay via use-livecode wrote: MouseDown is a message, not a function. You need: if the mouse is down then set the...etc. -- Jacqueline Landman Gay | jac...@hyperactivesw.com HyperActive Software | http://www.hyperactivesw.com On December 29, 2018 9:07:37 AM Richmond via use-livecode wrote: This does *NOT* work: on mouseEnter if mouseDown then set the backgroundColor of me to red else set the backgroundColor of me to green end if end mouseEnter on mouseLeave set the backgroundColor of me to white end mouseLeave which is a "right pox" Richmond. On 29.12.18 16:45, Richmond wrote: This may rank as one of the goofiest questions I've ever asked: Oh, well, here goes: Imagine a mosaic of faux buttons if you will. Each of these buttons will play a tone if I drag my mouse into it: on mouseEnter play audioClip "x.aiff" end mouseEnter All well and good . . . BUT, Richmond wants more . . . I want to get different results from a simple mouseEnter and a mouseEnter while the left-click button is down. Richmond. ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: MouseDown on Enter
MouseDown is a message, not a function. You need: if the mouse is down then set the...etc. -- Jacqueline Landman Gay | jac...@hyperactivesw.com HyperActive Software | http://www.hyperactivesw.com On December 29, 2018 9:07:37 AM Richmond via use-livecode wrote: This does *NOT* work: on mouseEnter if mouseDown then set the backgroundColor of me to red else set the backgroundColor of me to green end if end mouseEnter on mouseLeave set the backgroundColor of me to white end mouseLeave which is a "right pox" Richmond. On 29.12.18 16:45, Richmond wrote: This may rank as one of the goofiest questions I've ever asked: Oh, well, here goes: Imagine a mosaic of faux buttons if you will. Each of these buttons will play a tone if I drag my mouse into it: on mouseEnter play audioClip "x.aiff" end mouseEnter All well and good . . . BUT, Richmond wants more . . . I want to get different results from a simple mouseEnter and a mouseEnter while the left-click button is down. Richmond. ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: MouseDown on Enter
Not sure that's going to work ... if the mouse button is being held down, you won't get a "mouseenter" event. Dict says: If the mouse button is down when the mouse pointer enters the control, the *mouseEnter* message is not sent unless the mouse button is released while the pointer is still in the control. So you will probably need to use mousedown and mousestilldown to track that case. Alex. On 29/12/2018 14:45, Richmond via use-livecode wrote: This may rank as one of the goofiest questions I've ever asked: Oh, well, here goes: Imagine a mosaic of faux buttons if you will. Each of these buttons will play a tone if I drag my mouse into it: on mouseEnter play audioClip "x.aiff" end mouseEnter All well and good . . . BUT, Richmond wants more . . . I want to get different results from a simple mouseEnter and a mouseEnter while the left-click button is down. Richmond. ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: MouseDown on Enter
oopsi mean if mouse key is down :) On Sat, Dec 29, 2018 at 10:18 AM Tom Glod wrote: > I believe the Keysdown() function picks up the mousebutton as well. that > will give you the info whether enter key is down. > > On Sat, Dec 29, 2018 at 10:06 AM Richmond via use-livecode < > use-livecode@lists.runrev.com> wrote: > >> This does *NOT* work: >> >> on mouseEnter >> if mouseDown then >>set the backgroundColor of me to red >> else >>set the backgroundColor of me to green >> end if >> end mouseEnter >> >> on mouseLeave >> set the backgroundColor of me to white >> end mouseLeave >> >> which is a "right pox" >> >> Richmond. >> >> On 29.12.18 16:45, Richmond wrote: >> > >> > This may rank as one of the goofiest questions I've ever asked: Oh, >> > well, here goes: >> > >> > Imagine a mosaic of faux buttons if you will. >> > >> > Each of these buttons will play a tone if I drag my mouse into it: >> > >> > on mouseEnter >> > >> > play audioClip "x.aiff" >> > >> > end mouseEnter >> > >> > All well and good . . . >> > >> > BUT, Richmond wants more . . . >> > >> > I want to get different results from a simple mouseEnter >> > >> > and a mouseEnter while the left-click button is down. >> > >> > Richmond. >> > >> ___ >> use-livecode mailing list >> use-livecode@lists.runrev.com >> Please visit this url to subscribe, unsubscribe and manage your >> subscription preferences: >> http://lists.runrev.com/mailman/listinfo/use-livecode > > ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: MouseDown on Enter
I believe the Keysdown() function picks up the mousebutton as well. that will give you the info whether enter key is down. On Sat, Dec 29, 2018 at 10:06 AM Richmond via use-livecode < use-livecode@lists.runrev.com> wrote: > This does *NOT* work: > > on mouseEnter > if mouseDown then >set the backgroundColor of me to red > else >set the backgroundColor of me to green > end if > end mouseEnter > > on mouseLeave > set the backgroundColor of me to white > end mouseLeave > > which is a "right pox" > > Richmond. > > On 29.12.18 16:45, Richmond wrote: > > > > This may rank as one of the goofiest questions I've ever asked: Oh, > > well, here goes: > > > > Imagine a mosaic of faux buttons if you will. > > > > Each of these buttons will play a tone if I drag my mouse into it: > > > > on mouseEnter > > > > play audioClip "x.aiff" > > > > end mouseEnter > > > > All well and good . . . > > > > BUT, Richmond wants more . . . > > > > I want to get different results from a simple mouseEnter > > > > and a mouseEnter while the left-click button is down. > > > > Richmond. > > > ___ > use-livecode mailing list > use-livecode@lists.runrev.com > Please visit this url to subscribe, unsubscribe and manage your > subscription preferences: > http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: MouseDown on Enter
This does *NOT* work: on mouseEnter if mouseDown then set the backgroundColor of me to red else set the backgroundColor of me to green end if end mouseEnter on mouseLeave set the backgroundColor of me to white end mouseLeave which is a "right pox" Richmond. On 29.12.18 16:45, Richmond wrote: This may rank as one of the goofiest questions I've ever asked: Oh, well, here goes: Imagine a mosaic of faux buttons if you will. Each of these buttons will play a tone if I drag my mouse into it: on mouseEnter play audioClip "x.aiff" end mouseEnter All well and good . . . BUT, Richmond wants more . . . I want to get different results from a simple mouseEnter and a mouseEnter while the left-click button is down. Richmond. ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
MouseDown on Enter
This may rank as one of the goofiest questions I've ever asked: Oh, well, here goes: Imagine a mosaic of faux buttons if you will. Each of these buttons will play a tone if I drag my mouse into it: on mouseEnter play audioClip "x.aiff" end mouseEnter All well and good . . . BUT, Richmond wants more . . . I want to get different results from a simple mouseEnter and a mouseEnter while the left-click button is down. Richmond. ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode