If you run
controlpanel -s field1 focus 1
on a field comp, then you can start writing into the field right away, but hitting enter does not commit the changes.
You need to actually click into the field and hit enter to commit.
Also, running the click command on a field does not activate it.
And I just had a problem with the focus variable going on AND off at the same time, i.e. when clicking into the field i get an offtoon and an ontooff event in a DAT monitoring the fields focus variable. Couldn’t yet produce a testcase. Anyone experienced something like this before?
and another little bug, the borderspace parameter is not taken into account when the field is empty. In this case the cursor is on the leftmost border.
After many hours I finally found the reason for this. The fieldcomp focus variable goes to 0 when you open the controlpanel for it.
Here’s an example.
Just LMB on /field (and watch the textport)
the opened field is not in focus and the textport shows a focus ontooff script being triggered
The problem is that on focus ontooff a script should actually close the controlpanel, but due to an ontooff being fired when opening the panel, the panel never actually opens. You can try to reenable the controlpanel -c command (it’s commented out), but touch will likely crash. If it doesn’t crash, and then you’ll see that the panel never really opens
PS: I’m using this to be able to open the field with different dimensions based on LMB/MMB
A: LMB on field to edit in place
B: MMB on field to open it as a controlpanel with larger dimensions, so you can add more text (due to lack of scrolling support in the field comp) field.6.toe (1.84 KB)
The click command should at the very least work the same on a Field Component as it does on a Button, and trigger the select (and lselect,mselect,rselect) panel value. But it doesn’t.
And setting the focus sounds like a logical extension for Fields since that’s what happens with a real click.
Yes, I’ve been having some issues with the focus value lately as well and we are working on it. A big problem is that the value entered in a field is not always written the the DAT called string before focus goes off. Sometimes it happens before focus value goes off, sometimes after, its pretty random. Most of the time I want to do something with the new value entered into the field when focus goes off, but this random behavior means I get the old value often.