Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
CoffeeScript
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
src
test
.gitignore
README.md
package.json

README.md

HAPPY HANDS :raised_hands: :clap: :punch:

Happy Hands is a client side javascript library which helps you detect physical gestures coming from a mobile device.

Planned Sample Usage:

script(src = '/HappyHands.js')

punch = [[20, 50, 15, 9, 3, 6, 80, 5 ,1], [20, 50, 15, 9, 3, 6, 80, 5 ,1]]
kick  = [[20, 50, 15, 9, 3, 6, 80, 5 ,1], [20, 50, 15, 9, 3, 6, 80, 5 ,1]]
slap  = [[20, 50, 15, 9, 3, 6, 80, 5 ,1], [20, 50, 15, 9, 3, 6, 80, 5 ,1]]

hands = new HappyHands(
    accuracy    : 5
    poll_speed  : 3
)

Single Events

hands.on punch, ->
    alert 'FACE PUNCH'

hands.on slap, ->
    alert 'KICK'

Sequential Events

hands.on punch, ->
    hands.on slap, ->
        alert 'PUNCH SLAP'

Passing Options to Events

hands.on punch, (->
    alert 'PUNCH'
),
kill_on_complete    : true
accuracy            : 10

Generating "Records"

Records can be created from going to the happy hands web site and recording a gesture.

Compiling

coffee -c -w -o lib/ src/

Testing

mocha --compilers coffee:coffee-script -R spec

Something went wrong with that request. Please try again.