Based on the first selfie, this is what you try, or very close to.
https://www.dropbox.com/s/a28b1xucic0op ... .capx?dl=0
The second selfie makes no sense to me.
About the While loop. The events run in a loop already. Use any other loop only if you want an iteration to happen inside 1 tick. If you update graphics in a loop, and therefor inside the time of 1 tick, you will never see them updating, besides there where the loop ended, because the drawing happens at the end of every tick. Hence the term 'Frame Depended'.
About the 'and never lets go'. The text-box that you draw is 'in focus'. Meaning, it is stealing the mouse. A text-box is a form element. It does not live inside the canvas. It lives on top of the canvas in its own world. Basically canvas and form elements are different windows. If you have two windows on your desktop, the one that is in focus is getting keyboard and mouse changes. The other dont.
Just disable the object, so it can not switch to 'in focus'.
Ok so after a bit of time of rework after rework I made this which...half works. It works perfectly sometimes other times the textbox doesn't leave focus so if a mistake of some sort could be pinpointed that would be appreciated.
Img: https://drive.google.com/file/d/0Bxfvxf ... sp=sharing
I personally think its the "On button released" part but I don't know of a way around it.