WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 10-14-2008, 07:24 PM
djdesmangles djdesmangles is offline
Member
 
Join Date: Nov 2006
Posts: 88
Question vizinfo + wiimote ?

Hello Wizards,

How can I interact with vizinfo when using wiimote ?

viz.FOREVER
Reply With Quote
  #2  
Old 10-14-2008, 08:12 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
You can use the following code to simulate a mouse press/release in windows:
Code:
import win32api
import win32con

#Simulate left mouse button pressed
win32api.mouse_event(win32con.MOUSEEVENTF_LEFTDOWN,0,0,0)

#Simulate left mouse button released
win32api.mouse_event(win32con.MOUSEEVENTF_LEFTUP,0,0,0)
Just call the corresponding code when the wiimote button is pressed/released and you should now be able to interact with all GUI elements and other applications that are running on your system.
Reply With Quote
  #3  
Old 10-14-2008, 08:22 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Forgot to mention one important thing. You will also need to simulate mouse movement using the following code:
Code:
win32api.mouse_event(win32con.MOUSEEVENTF_ABSOLUTE,int(65535*x),int(65535*(1.0-y)),0)
The x,y values represent the normalized screen coordinates, which should be equal to the IR position of the wiimote, assuming you are in fullscreen mode.
Reply With Quote
  #4  
Old 10-21-2008, 03:21 PM
djdesmangles djdesmangles is offline
Member
 
Join Date: Nov 2006
Posts: 88
Unhappy ...not working

Yo !! Wizards !!

I simply cannot make that thing work... Are you sure it'll work inside a OpenGL rendered Window ?

viz.FOREVER !!
D.
Reply With Quote
  #5  
Old 10-21-2008, 03:44 PM
djdesmangles djdesmangles is offline
Member
 
Join Date: Nov 2006
Posts: 88
Some piece of code...

Here's some codes:

Code:
def onTimer(num):
	global wm_pX
	global wm_pY
	
	global mess1
	global mess2
	global mess3
	global crosshair
	
	if num == 0:
		wm_pX = wiimote.posIR[0]
		wm_pY = wiimote.posIR[1]
		
		crosshair.setPosition(wm_pX, wm_pY)
		win32api.mouse_event(win32con.MOUSEEVENTF_ABSOLUTE, int(wm_pX * 1680), int((1-wm_pY) * 1050), 0)
		
	if num == 1:
		if wiimote.state == 16:
			win32api.mouse_event(win32con.MOUSEEVENTF_LEFTDOWN, int(wm_pX * 1680), int((1-wm_pY) * 1050), 0)
			time.sleep(0.05)
Reply With Quote
  #6  
Old 10-22-2008, 08:33 AM
djdesmangles djdesmangles is offline
Member
 
Join Date: Nov 2006
Posts: 88
Source Code

Hello Wizards,

It's me again... This problem is driving me loco... I've attached the source code to the message...

viz.FOREVER !!!
D.
Attached Files
File Type: zip WiiGUI.zip (1.5 KB, 468 views)
Reply With Quote
  #7  
Old 10-22-2008, 02:18 PM
djdesmangles djdesmangles is offline
Member
 
Join Date: Nov 2006
Posts: 88
Talking It's working now...

Yo !!

It's working now... The problem was with the mouse pointer...

viz.FOREVER !!!
D.
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
Sending sound to Wiimote ? djdesmangles Vizard 1 07-31-2008 11:26 AM
wiimote and sensor bar masaki Vizard 1 03-06-2008 03:07 PM
"Vizard Lite" graphic obscuring vizinfo pups halley Vizard 0 05-30-2006 10:07 AM
vizinfo in HMD mode enkeli Vizard 8 03-01-2006 03:47 PM
vizinfo vadrian Vizard 1 11-05-2004 02:40 PM


All times are GMT -7. The time now is 11:36 AM.


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