Flonum/Number box interface question.
I’m pretty sure there isn’t, but is there any way to make a number box or flonum automatically deselect after hitting the enter/return key? I thought this was how it worked in 4.6 but it’s been a while so I could be wrong.
The problem is that I use some number keys for a tool change on a waveform~ object, and sometimes users seem to forget/not realize that they have to click elsewhere in the patch after entering data in a numeric input, and then trying to shift tools causes that numeric box to input irrelevant data.
one way you could do this is to use
You can select a number box by sending it the message "select", which of
course deselects other number boxes. So one way to do this would be to
trigger such a message to a hidden, dummy number box upon output from the
number boxes that you’re actually using.
> I’m pretty sure there isn’t, but is there any way to make a number box or
> flonum automatically deselect after hitting the enter/return key? I thought
> this was how it worked in 4.6 but it’s been a while so I could be wrong.
> The problem is that I use some number keys for a tool change on a waveform~
> object, and sometimes users seem to forget/not realize that they have to
> click elsewhere in the patch after entering data in a numeric input, and
> then trying to shift tools causes that numeric box to input irrelevant data.
Both of these are good ideas, but I’m not sure what the use of the [thispatcher] object is, in Raja’s idea. And Dan’s idea might confuse my users even more, since now whenever they type in a number to switch tools, it’s typing to a hidden number box, instead of something they can see.
I’ve approached the problem from a different angle, and just made the key commands be menu items with command-key links. Holding command+1 doesn’t type in a focused numeric box, so that seems to be working! But I like the ideas, I’m sure I’ll use them somewhere.
I realized after I wrote it, that using thispatcher to "ignoreclick" or "respondtoclick" wouldn’t work because they would still be typing numbers into the selected number-box(despite lack of mouse-input).
Daniel’s idea is a good one, too, however, any time numbers are being typed into any number box(hidden or otherwise), you lose the ability for object to pick up number-keypresses(so you could probably use the "cantchange" attribute of the hidden number box to achieve this solution).
So your final solution is probably the best and quickest.
However, here’s a solution according to your original plan which works so long as your users make sure they mouse outside the area of the number-box when they are done with it and surely, with some additional creative gating you can figure out how to mod this path to deselect the number-box when a return/enter keypress is detected. Just in case(eventually you might run out of key-shortcuts and will actually want the numbered keys), you can use this for future reference:
----------begin_max5_patcher---------- 1449.3ocyas0iZaDE9Y1eEGYEk1JsKxm4huTkDop9Z6ufpnJCLK3tf8J7Pyt MJ+26bwNKrArMAmC9EL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TtP0ZIgQwArBd0p9IFdk7yvFQNauRAbLp3fDRbYrwtS5U 5LspakCiiDWVI7AjdjcPOm7xwnrXx1cIQpQJwXl.jLPxAo.jRPFAxXPjz5lr 37rjTGX+PxjH10VOMTWOJ2S9l13YRuh6H4HvPh32Cpm6lV3NIKYpsTJmlVBO GZQb1ZpGcmNowe+7rB8b+YS4MX2mjJzK.42O3qSomHV8oYh6ONNI9P.NqSjj K531zedYMnyvhaMmy9wLtG0cnXd0YsyM4s2+P5ppb214MXn1eK7xzegwoXdQ lNurXu9XyiauNsJewBUw9ZRaxW7XoYFUiA3iGcsquP5UC2IvTBsXpGPxdV.I DRo8.R1LIIDRuZ3NwJGsXxVH2twT34goTe05k9MGW9RqKk.6inu8PRPHAJ6A jn0.gczvNPjcSMHFRrtfjfbHw6BRRxgjnKHQurjrKHESNjh5BRIjCo3tfTJ4 PJoKKkgjCoztfDRNj5zeBwg20qPNoUXBi6Klv9iI6oN2lHpudG7H+At8fVbt OuUgKBBWqKclzmvBYzJD1qHvHEQhdwRmGjXwtkaguHDB+YE7vVnvupKb8z05 RmHXOhERPqxjf8CfbYnmbQOcl5I28aghjCH2jggb6ZhHN2YB5JOkv+uXy1Jr t0kpk0Kzdl5YnwNk0xThnAsMstzLcvwWlNuJbgQAlXoiPLkLBwT7HDSivr4Y xQHlDiPLwGgXpWARQagOv9fIZyeF6yRGxnESgiNZJtGkrJkbD0UrrzV2i9XX 5RrAXZ7ka9e.uYstX -----------end_max5_patcher-----------
oh, and i’m finding that when i paste that into a new patch, i sometimes need to change the mouse-pickup-coordinates in the "if,then,else" objects that refer to the area within the big number box.
This is the very reason I don’t use numbers to trigger events, though they certainly are intuitive to use. And shift-# works, but that’s awkward. I stick to the row of keys below the numbers, and save the numbers for typing into the boxes.
You know about the right outlet of the number boxes, yes? Use that to hit a "select" to tab thru a series of connected number boxes, just like in most applications. This doesn’t solve your original problem of deselecting. If what you want is a "select nothing", one past forum posting spoke of a "create new number box, select it, delete it" method using thispatcher. You could have the tab key trigger that sequence via the right outlet.
This used to bug me a lot when I first switched from PD. I use this subpatch to deal with the problem.
----------begin_max5_patcher---------- 533.3oc2U1saaBCEG+Z3ovx8VVE1NgL1taO.SZ2ralplLvIIdBrivNaYqpu6 yeDRgLHMsaMpcJACbr8472+7giuMNBWn1AZL5cnufhhtMNJxaxYHZ+6Q3F9t xZt1OLrPVCFbRnmMbS4Zgb0WagRSvKT1hqSSPy7sj4csna1OEQk2Mphu8FRm ajaa7t0Ggz6Mp1Z5rR1aMXx7yMPHbX7AOWpZZ.oWF3kspFj0CEPqc4fpgkFT XpX2fuKN10jblqYI7Cqd6TqA1EBRAh8vfHKfiTOHVLNHnctYoRZj7F+ZC+Yn shK4nOnpqFkTjdyRK9keV4WON+XSwuBtbEN4n6nadBTpAzZ9J3OvjtrUrwfz frxskTAZn1RIUKJ7P2DpERnTsMrCRmFrjr25fYddH2x+BMabxxdZjk9HH6ox L+2SwJKxLvPN9XAHcQO9wleJ9M6+M9Y+T9njvPUBDK08mjhB+nzCOP5cQOb4 6cTxyll7r.syCkEyItarIJJL+UG5mnLoYsP6YAzdxxkYgumY9plYmpdY1ye8 R5jnIo+YNZ92653pO55ZvhEgeuq4pO4Zsk+BVFvVum74OGcJr2IN6CAtVsss rKj6O6.QOnGadsQH4FgR1aL1TIz8fbsnpBj8OpsQTsQIjl8RXhM+yUQjAQab EQunJxEMxCnH1EUQyOCFkcQUzrWbJh8hSQzyPQy9KTj8k6h+MvYM3x. -----------end_max5_patcher-----------
Just connect the output of your numberbox to this abstraction and it will deselect the numberbox whenever it sends output. If you like the stay selected ability sometimes, you could instead connect this patch to the tab outlet and so the numberbox will stay selected until you hit tab.
Roth, yours seems to work on it’s own, but when I connect it to a number box it stops doing anything, and I can’t figure out why. I see a bang going into the [b 3] object but the number box doesn’t deselect.
Very odd, but an excellent way of doing it (if I could get it to work :/)
Well, to be honest, I haven’t tried that trick since pre-Max5 (I have been putting off adding that abstraction to my new Max5 interfaces as a finishing step I was going to apply this weekend).
I’ll try to see if I can figure out what is going on over the next few days, but if someone else has a chance to offer some help before I can figure it out it would be much appreciated.
Perhaps this is a bug, because it works as expected in Max 4.6.3.
Current Max 5 observations:
•abstraction does not work as intended under Max 5
•manually triggering all three messages vs. triggering with [b 3] seems to work
•disconnecting "script delete numdeselctor" from the [b 3] seems to create a partially working abstraction. [thispatcher] successfully creates the new numberbox and selects it. After that, manually clicking the "script delete numdeselector" will successfully destroy it.
The problem appears to be with the "script delete" message to [thispatcher]. My guess, since the first two messages seem to worok on their own, is that after deleting the new numberbox, Max5 automatically selects the last selected numberbox.
Any word if this is a feature change or a bug?
I made some minor progress on your thing, Roth. It only works if the subpatcher is open, though. Not sure why.
----------begin_max5_patcher---------- 897.3oc0XsrbaCBEcs7WACYqaFAxOaW09AzY5ltISFOHIrCsRfFIraZyj+8x CIavVxVN1SFmMHo6kKb3be.hWFD.iEOSqffOCd.DD7xff.iHsff5uCf4jmSx HUltA4qyiokvgVUpuX7LpznCUKjkZ5oH9WeZFB2z0kBtjSxoFcesjQxZzTPj IOw3qVTRSjVrflL99vg.zrP8iwlVrpE73tIVrV1Ly3ZoVQx+VPsCCjwkvg.X LguBt0VMRpX+yzGD99PszWGLP2Lrur.8OpkWyBPRe1faXAHkVQyzKidSPgWB AgwlG0ezMAE1wR2cBTdU6BtdEq5MKitgVVwDbG3G.2AiwSmXlYzTCLFYbTil 4.DEStJSj7aZpCNBfozkm2nHJn7cVX5gWieOY7hRkmfKIxZv6Nyj0YxEsSE9 5WRRncZbq9p.3pRVpfqAgmkZwMSmx8YCuG6haSO3jhVLVJDYwjxMrJVbF0yW nhSIbVNQRkLKdvgasikWTpSAbGqbpjjRjDKPbbStUBbhB7xE7jerbB+7hTZF .6pwKs.6nvI0X574tlzMk2UJRnkjiLOhlteJRKoIHGMGTKwqHRmERBZJlXeY 3ajLyoUUjUzVYypjRVgTUpQgOJXCoL5boVD5pvr1pyyma+3syrGgUQ2Od9Xz rouuTqJTtNS2PufQ3wpZr.u895OYGdQjczHWxF2P8eTXaC8zIkE1AkcBNAOw jMOcZSUz8pkdlLhoDoqsIh7bpstIbYoHu1yqVwfL5RIvNBvqHMcjhmwftyuQ sye3Ni39IsLkvIfuIxR6GIO2zZ2SVuA8QH4nSV9b3dO6LTb96c0T0gERsI6d Gfq2Y4QWEJGE5jqivWbj86EAejvW4SrplyWdlgwSthbZyIkmzi3X7QozgmfV czTQ1zX1ceWanGY.feQ2b2OzspvOqDvis3W1cLsLFuqioYFXs91cXUh0kIMv otJKvmFT+8hjw2dl4G1VMYu98DKM0+HplHBVZgPUKsp4nk8J.6bQsFMndf5n aJTG0StdxMGWi6Ap0Gw4FB1s.mOBrMB8gMHoOn17+b2P3tM7zQ3M5JB7ZgpU vfs6QjtPMMpcrVPjxRV7ZosDu6cwboWKwQTcpaDYUlHljUus01wvajO.Qs9q wVVn9p1Lzo+1Y1adae+X88ucf+yb2h6bKc36l4WL3PGW6NssfbvqC9+yDqlu -----------end_max5_patcher-----------
So it looks like something in the Max 5 drawing system killed this script. It looks like the "select" message will not select numberboxes in closed subpatches. Also, maybe the timing of object generation has changed, but the delete message does seem to need to be differed.
destroyme = this.patcher.newdefault(50, 50, "number");
t = new Task(destroyIt, this, destroyme);
//scheduling delay in ms, increase if numberboxes do not deselect
destroyme = this.patcher.newdefault(50, 50, "number");
t =new Task(destroyIt, this, destroyme);
//scheduling delay in ms, incease if numberboxes do not deselect