Re: [PD] Data structures and their clickable area
On 01/29/2014 05:40 PM, Roman Haefeli wrote: On Mon, 2014-01-27 at 21:34 -0500, Jonathan Wilkes wrote: On 01/27/2014 05:35 PM, Roman Haefeli wrote: Hi I'm using a template consisting of a rectangle done with [filledpolygon] and a number [drawnumber] in it. While mouse clicks anywhere in the area of the rectangle are detected, it's only possible to change the number with the keyboard when I exactly click on the number. Is there a way to make the number catch the keyboard no matter where I click in the rectangle? One possibility is to make the hotspot bbox settable. Actually, something like this would be on my wishlist. Knowing it does not exist yet, I hoped for some kludge solution. It would literally be five minutes of dev time. But I'm not sure it's the ideal solution since often you want a hotspot to exceed the formal bounds of an object, and this wouldn't do that. Still, I'll code it up and see how it works. Or maybe have a method to forward widgetbehaviors to another drawing command. Would certainly be interesting too, though having the hotspot area be configurable would make this less important. Probably best to just fool around with Raphael.js or some such library to see what it does, and see what can be ported. -Jonathan Anyway, thanks for your thoughts. Roman ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Re: [PD] Data structures and their clickable area
On Mon, 2014-01-27 at 23:35 +0100, Roman Haefeli wrote: > Hi > > I'm using a template consisting of a rectangle done with [filledpolygon] > and a number [drawnumber] in it. While mouse clicks anywhere in the area > of the rectangle are detected, it's only possible to change the number > with the keyboard when I exactly click on the number. Is there a way to > make the number catch the keyboard no matter where I click in the > rectangle? To answer my own question: I had some thought about dealing with the 'capture the keyboard' part. When clicking the rectangle, I could use the pointer to route keyboards events from [keyname] to the clicked scalar. This way, I could even use 'Left' and 'Right' key events to move the scalar selection with the keyboard. This would allow to set a whole array of numbers by only using the keyboard. It's still not clear how to unselect the whole thing, when data entry is completed, though. I believe many interfaces allow de-select something by clicking anywhere nearby. Don't know if that is feasible in Pd. Using a key would be another option. The 'Escape' key, for instance. Roman ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Re: [PD] Data structures and their clickable area
On Die, 2014-01-28 at 12:40 +0100, João Pais wrote: > there might be a complicated and confuse way of doing it - by clicking the > scalar, you activate a click message to the drawing window, that clicks in > the drawed number. For that you would have to look around the click > messages in the pd documents, which I didn't really understood so far. Can you intercept mouse events done in the canvas? Can you even do it without externals? Roman > > On 01/27/2014 05:35 PM, Roman Haefeli wrote: > >> Hi > >> > >> I'm using a template consisting of a rectangle done with [filledpolygon] > >> and a number [drawnumber] in it. While mouse clicks anywhere in the area > >> of the rectangle are detected, it's only possible to change the number > >> with the keyboard when I exactly click on the number. Is there a way to > >> make the number catch the keyboard no matter where I click in the > >> rectangle? > > > > That's not possible. Essentially what you want is to take a click from > > one draw command-- [filledpolygon]-- and "map" it or forward it to > > another-- [drawnumber]. Scalars don't give you any tools to hook in to > > a parent drawing command's widgetbehavior that way. > > > >> Similarly, I'd like to be able to mouse-drag anywhere in the > >> rectangle in order to change the value of the number. > > > > You could probably do it if you use a field variable to define hotspots > > on every 6x6 tile of the rectangle. But you'd also have to constrain > > movement of the rectangle by abusing the quanta syntax, something like > > (-whatever:whatever)(0:0). That would presumably constrain the field > > variable's screen coordinates so that it doesn't move when you > > click-drag it. Then use the same field variable for your [drawnumber]. > > > > I'm almost finished with some new drawing instructions for data > > structures in Pd-l2ork that implement a subset of the svg spec. I've got > > some mouseover/mouseout widgetbehaviors working, but still nothing > > particularly sophisticated in terms of mapping mouse/keyboard > > interaction to field variables. > > > > One possibility is to make the hotspot bbox settable. Or maybe have a > > method to forward widgetbehaviors to another drawing command. > > > > -Jonathan > > > >> > >> Any ideas? > >> > >> Roman > >> > >> > >> > >> ___ > >> Pd-list@iem.at mailing list > >> UNSUBSCRIBE and account-management -> > >> http://lists.puredata.info/listinfo/pd-list > > > > > > ___ > > Pd-list@iem.at mailing list > > UNSUBSCRIBE and account-management -> > > http://lists.puredata.info/listinfo/pd-list > > ___ > Pd-list@iem.at mailing list > UNSUBSCRIBE and account-management -> > http://lists.puredata.info/listinfo/pd-list ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Re: [PD] Data structures and their clickable area
On Mon, 2014-01-27 at 21:34 -0500, Jonathan Wilkes wrote: > On 01/27/2014 05:35 PM, Roman Haefeli wrote: > > Similarly, I'd like to be able to mouse-drag anywhere in the > > rectangle in order to change the value of the number. > > You could probably do it if you use a field variable to define hotspots > on every 6x6 tile of the rectangle. But you'd also have to constrain > movement of the rectangle by abusing the quanta syntax, something like > (-whatever:whatever)(0:0). Interesting idea. > That would presumably constrain the field > variable's screen coordinates so that it doesn't move when you > click-drag it. I'm not sure, if I fully understand the quanta syntax. I'd assumed that something like x(-30:30)(0:0) would not allow any movement, as you suggest. But it is still movable as if I'd use plain x (without quanta). When I use something like x(-30:30)(-1:1), it jumps between -30 and 30. > Then use the same field variable for your [drawnumber]. Unfortunately, when using quanta, the variable doesn't return the input (my mouse movement), but the result. So the number jumps between -30 and 30 as well. Roman ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Re: [PD] Data structures and their clickable area
On Mon, 2014-01-27 at 21:34 -0500, Jonathan Wilkes wrote: > On 01/27/2014 05:35 PM, Roman Haefeli wrote: > > Hi > > > > I'm using a template consisting of a rectangle done with [filledpolygon] > > and a number [drawnumber] in it. While mouse clicks anywhere in the area > > of the rectangle are detected, it's only possible to change the number > > with the keyboard when I exactly click on the number. Is there a way to > > make the number catch the keyboard no matter where I click in the > > rectangle? > > One possibility is to make the hotspot bbox settable. Actually, something like this would be on my wishlist. Knowing it does not exist yet, I hoped for some kludge solution. > Or maybe have a > method to forward widgetbehaviors to another drawing command. Would certainly be interesting too, though having the hotspot area be configurable would make this less important. Anyway, thanks for your thoughts. Roman ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Re: [PD] Data structures and their clickable area
there might be a complicated and confuse way of doing it - by clicking the scalar, you activate a click message to the drawing window, that clicks in the drawed number. For that you would have to look around the click messages in the pd documents, which I didn't really understood so far. João On 01/27/2014 05:35 PM, Roman Haefeli wrote: Hi I'm using a template consisting of a rectangle done with [filledpolygon] and a number [drawnumber] in it. While mouse clicks anywhere in the area of the rectangle are detected, it's only possible to change the number with the keyboard when I exactly click on the number. Is there a way to make the number catch the keyboard no matter where I click in the rectangle? That's not possible. Essentially what you want is to take a click from one draw command-- [filledpolygon]-- and "map" it or forward it to another-- [drawnumber]. Scalars don't give you any tools to hook in to a parent drawing command's widgetbehavior that way. Similarly, I'd like to be able to mouse-drag anywhere in the rectangle in order to change the value of the number. You could probably do it if you use a field variable to define hotspots on every 6x6 tile of the rectangle. But you'd also have to constrain movement of the rectangle by abusing the quanta syntax, something like (-whatever:whatever)(0:0). That would presumably constrain the field variable's screen coordinates so that it doesn't move when you click-drag it. Then use the same field variable for your [drawnumber]. I'm almost finished with some new drawing instructions for data structures in Pd-l2ork that implement a subset of the svg spec. I've got some mouseover/mouseout widgetbehaviors working, but still nothing particularly sophisticated in terms of mapping mouse/keyboard interaction to field variables. One possibility is to make the hotspot bbox settable. Or maybe have a method to forward widgetbehaviors to another drawing command. -Jonathan Any ideas? Roman ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Re: [PD] Data structures and their clickable area
On 01/27/2014 05:35 PM, Roman Haefeli wrote: Hi I'm using a template consisting of a rectangle done with [filledpolygon] and a number [drawnumber] in it. While mouse clicks anywhere in the area of the rectangle are detected, it's only possible to change the number with the keyboard when I exactly click on the number. Is there a way to make the number catch the keyboard no matter where I click in the rectangle? That's not possible. Essentially what you want is to take a click from one draw command-- [filledpolygon]-- and "map" it or forward it to another-- [drawnumber]. Scalars don't give you any tools to hook in to a parent drawing command's widgetbehavior that way. Similarly, I'd like to be able to mouse-drag anywhere in the rectangle in order to change the value of the number. You could probably do it if you use a field variable to define hotspots on every 6x6 tile of the rectangle. But you'd also have to constrain movement of the rectangle by abusing the quanta syntax, something like (-whatever:whatever)(0:0). That would presumably constrain the field variable's screen coordinates so that it doesn't move when you click-drag it. Then use the same field variable for your [drawnumber]. I'm almost finished with some new drawing instructions for data structures in Pd-l2ork that implement a subset of the svg spec. I've got some mouseover/mouseout widgetbehaviors working, but still nothing particularly sophisticated in terms of mapping mouse/keyboard interaction to field variables. One possibility is to make the hotspot bbox settable. Or maybe have a method to forward widgetbehaviors to another drawing command. -Jonathan Any ideas? Roman ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
[PD] Data structures and their clickable area
Hi I'm using a template consisting of a rectangle done with [filledpolygon] and a number [drawnumber] in it. While mouse clicks anywhere in the area of the rectangle are detected, it's only possible to change the number with the keyboard when I exactly click on the number. Is there a way to make the number catch the keyboard no matter where I click in the rectangle? Similarly, I'd like to be able to mouse-drag anywhere in the rectangle in order to change the value of the number. Any ideas? Roman ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list