Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add Voice control interface #32
Merged
Commits
Jump to file or symbol
Failed to load files and symbols.
Diff settings
API interface for simulating pressing button
- Loading branch information...
Jeff Zhang
authored and Jeff Zhang
committed
Jun 30, 2016
commit f9c564cf68ebfee675da00743a1a52c17d701096
| @@ -0,0 +1,16 @@ | ||
| +var mapButtontoIndex = {"A":0, "B":1, "Select":2, "Start":3, "Right":4, "Left": 5, "Up":6 ,"Down":7, "R":8, "L":9} | ||
| + | ||
| +function pressButton(button, time) { | ||
| + | ||
| + if(button in mapButtontoIndex ){ | ||
| + | ||
| + index = mapButtontoIndex[button] | ||
| + IodineGUI.Iodine.keyDown(index); | ||
| + | ||
| + setTimeout(function() { | ||
| + IodineGUI.Iodine.keyUp(index); | ||
| + }, time); | ||
| + } | ||
| + | ||
| + return; | ||
| +} |