Alice Community  

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

Reply
 
Thread Tools Display Modes
Blocking Key presses
Old
h4l0
Guest
 
Status:
Posts: n/a
Default Blocking Key presses - 04-24-2009, 02:04 AM

I have some events that call methods with keypresses. Is there a way to block keypresses while one method is running?

h4l0
   
Reply With Quote
Old
Scott300
Senior Member
 
Status: Offline
Posts: 80
Join Date: Feb 2009
Location: Ohio
Default 04-24-2009, 08:46 AM

Use Booleans

make a variable called block_b make it = false

now in the method that you have called when you hit b put the code in

if block_b == false
{
code here
}
else
{
code if b is blocked here
}
Now when ever you wanna block b all you have to do is set block_b = true
  Send a message via AIM to Scott300 Send a message via MSN to Scott300  
Reply With Quote
Reply

Thread Tools
Display Modes

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 ©2020, Carnegie Mellon University
Alice 2.x 1999-2012, Alice 3.x 2008-2012, Carnegie Mellon University. All rights reserved.