fix "message" capitalization in leap driver

fix leap examples
This commit is contained in:
Homer Strong 2014-07-15 11:11:25 -07:00 committed by Adrian Zankich
parent cdb26ad036
commit 3a0a677abe
4 changed files with 5 additions and 5 deletions

View File

@ -14,7 +14,7 @@ func main() {
l := leap.NewLeapMotionDriver(leapMotionAdaptor, "leap") l := leap.NewLeapMotionDriver(leapMotionAdaptor, "leap")
work := func() { work := func() {
gobot.On(l.Event("Message"), func(data interface{}) { gobot.On(l.Event("message"), func(data interface{}) {
fmt.Println(data.(leap.Frame)) fmt.Println(data.(leap.Frame))
}) })
} }

View File

@ -14,7 +14,7 @@ func main() {
l := leap.NewLeapMotionDriver(leapMotionAdaptor, "leap") l := leap.NewLeapMotionDriver(leapMotionAdaptor, "leap")
work := func() { work := func() {
gobot.On(l.Event("Message"), func(data interface{}) { gobot.On(l.Event("message"), func(data interface{}) {
printHands(data.(leap.Frame)) printHands(data.(leap.Frame))
}) })
} }

View File

@ -30,7 +30,7 @@ func main() {
l := leap.NewLeapMotionDriver(leapMotionAdaptor, "leap") l := leap.NewLeapMotionDriver(leapMotionAdaptor, "leap")
work := func() { work := func() {
gobot.On(l.Event("Message"), func(data interface{}) { gobot.On(l.Event("message"), func(data interface{}) {
fmt.Println(data.(leap.Frame)) fmt.Println(data.(leap.Frame))
}) })
} }

View File

@ -20,7 +20,7 @@ func NewLeapMotionDriver(a *LeapMotionAdaptor, name string) *LeapMotionDriver {
), ),
} }
l.AddEvent("Message") l.AddEvent("message")
return l return l
} }
@ -39,7 +39,7 @@ func (l *LeapMotionDriver) Start() bool {
for { for {
var msg []byte var msg []byte
websocket.Message.Receive(l.adaptor().ws, &msg) websocket.Message.Receive(l.adaptor().ws, &msg)
gobot.Publish(l.Event("Message"), l.ParseFrame(msg)) gobot.Publish(l.Event("message"), l.ParseFrame(msg))
} }
}() }()