|
[ENH]Keyboard contoll of etoy scripts.: msg#01271lang.smalltalk.squeak.general
Here is a stab at getting keyboard controll over etoy scripts. This is usefull when you want to steer your car on the road, fire bullet's at aliens etc. using keyboard instead of mouse. I would like to hear from someone with greater knowledge of the morphic environment than I whether this changeset will introduce some problems as it adds a couple of methods to Morph. >From preamble: "Change Set: etoy keystroke Date: 28 August 2002 Author: Karl Ramberg Adds ability for any morphs to recive keystrokes and trigger etoy scripts. To test this: Add a morph to your project. Open a viewer on the morph. Add a new script to it. Set the trigger to keystroke. Add a test tile to the script. Select Basic category in the viewer flap. Drag and drop a 'morph's keystroke' tile to the test part of the test tile. Now set the 'morph's hasKeyboardFocus' to true. Press a key. Look in the viewer keystroke tile and notice that there is a number next to it. This is the keystrokes ASCII number. Change the test tile to check for conditions when the the keystroke is equal to that number. Then add a tile to the tests 'Yes' condition something like 'morph forward by 5' Now when the morph has keyboard focus and you press the key that equals the number you put in, the morph will move forward by 5. Enjoy"
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: private methods: your opinion wanted, Aaron |
|---|---|
| Next by Date: | Re: Scrolling tables, Aaron |
| Previous by Thread: | Object Prevalence: another persistence idea, Ned Konz |
| Next by Thread: | Re: [ENH]Keyboard contoll of etoy scripts., Ned Konz |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |