Hi,

I have made a custom Morph to look for keyboard events when it is the
current mouse focus.  Is there anyone out there who could look at my class
and give me suggestions / observations?

I am wondering if I made any bad practices or bad oversights.  My
techniques were culled from a number of different tutorials and looking at
existing classes.  I have implemented it on a 3.6-based image.

I appreciate any help.

I will attach the class which you can file-in.  It is called
"KeyMoverMorph" and is in the category "My Morph".  Its behavior includes:

- drawing a border when it is mouse focus
- looking for keyboard events when it is mouse focus
- changes to color yellow when 'o' is pressed on it, blue when 'c' is pressed
- when it is focus, keyboard arrow keys move it up, down, left, and right

If there are better ways for me to do any of these things please let me know.

Thanks,
Tim

Attachment: KeyMoverMorph.st
Description: Binary data

_______________________________________________
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners

Reply via email to