We are about to switch to a new forum software. Until then we have removed the registration on this forum.
I want to run some code when the sketch get the focus... Do you known some trick ?
This works for me:
boolean loseFocus; void setup() { size(300,300); background(0); loseFocus = false; } void draw() { if (focused && loseFocus) { println ("get focus"); loseFocus = false; } else if (!focused) { loseFocus = true; } }
cameyo
@cameyo -- Interesting. That works for me as well on OS X 10.12.3 Processing 3.3.
I didn't know about focused -- where did you learn about it?
focused
@jeremydouglass: my editor highlights the word focused... then I have found it within the file \processing-3\modes\java\keywords.txt :)
\processing-3\modes\java\keywords.txt
http://ProcessingJS.org/reference/focused/
Answers
This works for me:
cameyo
@cameyo -- Interesting. That works for me as well on OS X 10.12.3 Processing 3.3.
I didn't know about
focused
-- where did you learn about it?@jeremydouglass:
my editor highlights the word
focused
...then I have found it within the file
\processing-3\modes\java\keywords.txt
:)cameyo
http://ProcessingJS.org/reference/focused/