Alice Community  

Go Back   Alice Community > Alice 2 > How do I...?

Reply
 
Thread Tools Display Modes
Old
geek in training
Junior Member
 
geek in training's Avatar
 
Status: Offline
Posts: 6
Join Date: Jul 2011
Default 08-01-2011, 01:38 PM

Step 1: add an object to the world, any object, you can even use the camera if you want

Step 2: in that object's procedures, add a keyeventlistener method to your code

Step 3: drag an if block inside the key listener and select 'true'

Step 4: select the arrow next to 'true' and select 'keyevent e =' then proceed to select whatever key you wish to bind to whatever action


this was posted by antmj2317 in the key listener and mouse button listener thread http://www.alice.org/community/showt...0083#post40083

for step 4 you could use "e is key (choose a key)" instead of "keyevent e ="
   
Reply With Quote
Old
x2495iiii
Super Moderator
 
x2495iiii's Avatar
 
Status: Offline
Posts: 3,508
Join Date: Dec 2008
Location: Somewhere in the Continental U.S.
Default 08-01-2011, 07:30 PM

Thanks for the info.

I'll have to try that NetBeans thing at some point.
   
Reply With Quote
Old
geek in training
Junior Member
 
geek in training's Avatar
 
Status: Offline
Posts: 6
Join Date: Jul 2011
Default 08-01-2011, 08:00 PM

you mean the net beans plugin for Alice 3? what does that do?
   
Reply With Quote
Old
x2495iiii
Super Moderator
 
x2495iiii's Avatar
 
Status: Offline
Posts: 3,508
Join Date: Dec 2008
Location: Somewhere in the Continental U.S.
Default 08-01-2011, 08:03 PM

It lets you import the world you've made into a more traditional java editing interface, allowing you more freedom over the raw code of the Alice world.

This should mean that the code can be exported into other formats besides Alice Worlds, but I haven't tried it, so I don't know.
   
Reply With Quote
To get a KeyListener in Alice 3
Old
guntherk
Junior Member
 
Status: Offline
Posts: 1
Join Date: Aug 2011
Location: Daejeon, South Korea
Default To get a KeyListener in Alice 3 - 08-20-2011, 05:13 AM

To get a KeyListener in Alice 3


1. Select the scene instance
2. The listener events available will be in the procedures listing
3. Select the addKeyListener
4. Bring an if down into the "do in order" section of the keyPressed procedure
5. Options for what the KeyEvent parameter e will now be available for selecting in the if conditional section.
6. Place your procedures for if/else into the sections.

PS- I'm on linux too, so I'm forcing my students on Mac and PC to work on Alice 3. Currently at 3.0.0.3
So far I've found Alice 3.0.0.3 and 3.0.0.2.10 unstable on Ubuntu 11.04, but fine on 10. I'm using 10.04 LTS for my classroom machine and 10.10 at home. Also couldn't get it to work on Linux Mint 11

On Mac OS X, we couldn't get 3.0.0.2.10 to go on systems under 10.6. We did get 3.0.0.3 to work fine on 10.5.x
   
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Copyright ©2024, Carnegie Mellon University
Alice 2.x © 1999-2012, Alice 3.x © 2008-2012, Carnegie Mellon University. All rights reserved.