[Newbies] help regarding keyboard event

K. K. Subramaniam subbukk at gmail.com
Sat Mar 13 06:56:47 UTC 2010


On Thursday 11 March 2010 04:16:52 am priti verma wrote:
> hi,
> I want to know how to invoke key press event in squeak speacly tab key
> pressed??if any one have any study material or any thing please help

In Squeak, keystrokes are converted into events (KeyboardEvent) by the main 
loop and passed onto the active Hand (a HandMorph). The hand then picks the 
morph which has the current keyboard focus and can handle keystrokes to pass 
on the key pressed.

In Etoys, the last key pressed is available in World's lastKeyStroke property 
of input category.

To receive keystrokes, add a method handlesKeyboard: to return true and put 
the keystroke handling logic in keyStroke: method. You may also want to handle 
focus change notifications in a keyboardFocusChange: method.

See these methods in PluggableListMorph, TextMorph for examples.

HTH .. Subbu


More information about the Beginners mailing list