Dirty Textedit

I want to change the background of the textedit object when you click on it and then have it change back when you have clicked out of it.

It is almost possible (see patch attached) but there is no ‘clicked off’ or deactivated info coming out of it unless the text changes. Is there a way to make it dirty so it always outputs that it has been activated and now it isn’t?

Thanks in advance!

Div

— Pasted Max Patch, click to expand. —

Copy all of the following text. Then, in Max, select New From Clipboard.