On Monday 01 April 2002 02:19 pm, Ken G. Brown wrote:
I would like to have one of my AcceptableCleanTextMorphs pass characters through to the #accept method as characters are typed, a character at a time. What would the best way to accomplish that? #hasUnacceptedEdits might do it I suspect but how? Where would I need to do the check?
Perhaps AcceptableCleanTextMorph is not the right way to address the problem. Basically I need a small command window that immediately sends characters when typed.
You need to make sure that you get mouse focus (tell the Hand when the mouse enters you), then override handlesKeyboard: to return true, and override keyStroke:.
Look at (for instance) Tetris to see how to do this.