Author Topic: GLOVEPIE code for point and click cursor function  (Read 6862 times)

Offline Mitymouse55

  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
on: January 22, 2008, 07:21:45 PM

Hey, I really need some help with this code.  this runs well on occasion but often clicks inadvertently and is not very smooth at all.  Could someone help me or possibly post a link to a similar code that works better than mine.

This code follows finger tracking of one IR point and then clicks if a second IR point shows up anywhere.... at least that was my intention.  I am not very good with GlovePIE coding yet.  I found out about it yesterday.

Here is the code


if wiimote.dot1vis then
if abs(wiimote.dot1x - var.ox) > 1 then
Mouse.CursorPosX = smooth(((1024-wiimote.dot1x) * Screen.Width / 1024) * 1.1 - 50, 10)
var.ox = wiimote.dot1x
endif
if abs(wiimote.dot1y - var.oy) > 1 then
Mouse.CursorPosY = Screen.Height - smooth(((wiimote.dot1y) * Screen.Height / 768) * 1.1 - 40, 10)
var.oy = wiimote.dot1y

endif
Mouse.leftButton = wiimote.dot2vis

endif