WiiLi Wiki frontpage Include your post in the News Get links Hoteles Quito
WiiLi.org Forum Index WiiLi.org
a new revolution
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Button locks once pressed

 
Post new topic   Reply to topic    WiiLi.org Forum Index -> GlovePie
View previous topic :: View next topic  
Author Message
Klorixx



Joined: 05 Aug 2008
Posts: 1

Digg It
PostPosted: Tue Aug 05, 2008 4:08 am    Post subject: Button locks once pressed

Hello!

First post and everything.
Anyways, I've found this little program and so today and been stucked with it for about 4hours straight now.

Mostly I've been looking at pre-made scripts but none of them contains exactly the things I want to I decided to build my own.

However, my problem now is that I want to be able to use the B button as mouse leftclick, but only when A button is pressed (which also activates my mouse control). Now, the problem is that when I press B while holding A, it locks. It remains pressed no matter what.

Here's my code:
Code:

// Klorixx script - going to contain everything I want (mostly, controll winamp and being able to surf)

var.xTrim = 0.25
var.yTrim = -28
var.zTrim = 7

var.x = Wiimote1.RawForceX + var.xTrim
var.y = Wiimote1.RawForceY + var.yTrim
var.z = Wiimote1.RawForceZ + var.zTrim

debug = "x="+var.x+" y="+var.y+" z="+var.z

if wiimote1.A
   var.apressed = 1
// vars for smoothing
var.smooth1 = 0.002
var.smooth2 = 0.01
var.smooth3 = 0.025
// X-axis step 1
if var.x > 5
   Mouse.x = Mouse.x - var.smooth1
endif
if var.x < -5
   Mouse.x = Mouse.x + var.smooth1
endif
//step 2
if var.x > 10
   Mouse.x = Mouse.x - var.smooth2
endif
if var.x < -10
   Mouse.x = Mouse.x + var.smooth2
endif
//step 3
if var.x > 15
   Mouse.x = Mouse.x - var.smooth3
endif
if var.x < -15
   Mouse.x = Mouse.x + var.smooth3
endif

//And y-axis step 1
if var.z > 2
   Mouse.y = Mouse.y - var.smooth1
endif
if var.z < -2
   Mouse.y = Mouse.y + var.smooth1
endif
//step 2
if var.z > 5
   Mouse.y = Mouse.y - var.smooth2
endif
if var.z < -5
   Mouse.y = Mouse.y + var.smooth2
endif
//Step 3
if var.z > 8
   Mouse.y = Mouse.y - var.smooth3
endif
if var.z < -8
   Mouse.y = Mouse.y + var.smooth3
endif
if Mouse.LeftButton
   Mouse.LeftButton = false
endif
else
    var.apressed = 0
endif

if var.apressed then
   Mouse.LeftButton = wiimote1.B
endif
key.Play = wiimote1.Down
key.NextTrack = wiimote1.right
key.PrevTrack = wiimote1.left
key.Mute = wiimote1.Up
Alt + F4 = wiimote1.Two


Could anyone be kind to help me out with this or give me some sort of pointer?

(and before anyone going to whine about it, yes, I've searched. However, It's 6am here thou so I might missed some thread)
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    WiiLi.org Forum Index -> GlovePie All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group