Welcome to Hackster!
Hackster is a community dedicated to learning hardware, from beginner to pro. Join us, it's free!
Hackster is hosting Impact Spotlights: Industrial Automation. Watch the stream live on Thursday!Hackster is hosting Impact Spotlights: Industrial Automation. Stream on Thursday!
Ben WilcoxSoje RiversDerek GilbertiCasey N.
Created December 6, 2021

Take Me Out to the BallGAME

18
Take Me Out to the BallGAME

Story

Read more

Code

Untitled file

JavaScript
input.touchA2.onEvent(ButtonEvent.Down, function () {
    keyboard.functionKey(KeyboardFunctionKey.LeftArrow, KeyboardKeyEvent.Down)
})
input.touchA2.onEvent(ButtonEvent.Up, function () {
    keyboard.functionKey(KeyboardFunctionKey.LeftArrow, KeyboardKeyEvent.Up)
})
input.touchA6.onEvent(ButtonEvent.Down, function () {
    keyboard.functionKey(KeyboardFunctionKey.RightArrow, KeyboardKeyEvent.Down)
})
input.touchA6.onEvent(ButtonEvent.Up, function () {
    keyboard.functionKey(KeyboardFunctionKey.RightArrow, KeyboardKeyEvent.Up)
})
input.touchA5.onEvent(ButtonEvent.Down, function () {
    keyboard.functionKey(KeyboardFunctionKey.UpArrow, KeyboardKeyEvent.Down)
})
input.touchA5.onEvent(ButtonEvent.Up, function () {
    keyboard.functionKey(KeyboardFunctionKey.UpArrow, KeyboardKeyEvent.Up)
})
input.touchA1.onEvent(ButtonEvent.Down, function () {
    keyboard.functionKey(KeyboardFunctionKey.DownArrow, KeyboardKeyEvent.Down)
})
input.touchA1.onEvent(ButtonEvent.Up, function () {
    keyboard.functionKey(KeyboardFunctionKey.DownArrow, KeyboardKeyEvent.Up)
})
forever(function () {
    if (input.acceleration(Dimension.Strength) > 2000) {
        keyboard.type("z")
    }
})

Credits

Ben Wilcox
4 projects • 0 followers
Contact
Soje Rivers
4 projects • 0 followers
Contact
Derek Gilberti
4 projects • 1 follower
Contact
Casey N.
4 projects • 1 follower
Contact

Comments

Please log in or sign up to comment.