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'.