WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 03-14-2008, 08:35 AM
shivanangel shivanangel is offline
Member
 
Join Date: Feb 2006
Location: New Jersey
Posts: 182
Sensor callback to the wii mote buttons

I read over the tutorial script and I created two callbacks for a sensor up and sensor down event.

The tutorial uses vizact commands,
I am not so much a fan of these and I was wondering if I can do button checking the 'classic' way:

if b = wii.BUTTON_A:

How do I go about doing this? I'm not sure what kind of object is being returned in the callback functions.


Thanks,
George
Reply With Quote
  #2  
Old 03-14-2008, 09:25 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
The Event Reference section of the docs explains how to use viz.SENSOR_DOWN_EVENT and viz.SENSOR_UP_EVENT. These will be triggered when a sensor button is pressed/released.
Reply With Quote
  #3  
Old 03-14-2008, 09:41 AM
shivanangel shivanangel is offline
Member
 
Join Date: Feb 2006
Location: New Jersey
Posts: 182
Yes,

I have taken a look at this section and it does cover how the sensor_down and up event work.

However, in the example given it maps a button from a joystick to a variable and then checks if that is the object in question.

With the wiimote, you have a section in the reference which specifies
<wii>.BUTTON_LEFT
<wii>.BUTTON_A
...

when setting up my conditional statement what do I put in there to check the event.

I looked and saw that an event is being returned as 'e' in the callback, then when I did e.object, it told me : __main__._WiimoteSensor(0)

So it is returning a WiimoteSensor, however how do I access what button from the sensor is being pressed? All buttons return the same __main__._WiimoteSensor(0) for the sensor, so I need to go a level deeper to do my check. How do I do this?

Thank You,

George
Reply With Quote
  #4  
Old 03-14-2008, 09:45 AM
shivanangel shivanangel is offline
Member
 
Join Date: Feb 2006
Location: New Jersey
Posts: 182
Wow, I'm sorry I'm a complete and total idiot.

The answer is right there in the DOC staring me in the face.

I think I've been at a computer for too long.

Thanks again!

George
Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Strange Wii Mote error... shivanangel Vizard 8 02-18-2009 12:32 PM
Using Window Buttons Uttama_vizard Vizard 2 01-16-2008 10:25 AM
Buttons Not rendering to both Eyes in 3d shivanangel Vizard 2 05-24-2007 06:58 AM
Vanda(Wanda) buttons giancamati Vizard 1 12-07-2006 10:21 AM


All times are GMT -7. The time now is 01:07 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC