add Voice control interface #32

Merged
merged 5 commits into from Jul 8, 2016
Jump to file or symbol
Failed to load files and symbols.
+0 −42
Diff settings

Always

Just for now

Viewing a subset of changes. View all

clean up

  • Loading branch information...
Jeff Zhang Jeff Zhang
Jeff Zhang authored and Jeff Zhang committed Jul 8, 2016
commit a1193abece4bbdbf202ef4dff3e23cd9830828bf
@@ -329,19 +329,12 @@ GameBoyAdvanceEmulator.prototype.initializeCore = function () {
return allowInit | 0;
}
GameBoyAdvanceEmulator.prototype.keyDown = function (keyPressed) {
- console.log("keydown emulator");
- console.log(keyPressed);
-
keyPressed = keyPressed | 0;
if ((this.emulatorStatus | 0) < 0x10 && (keyPressed | 0) >= 0 && (keyPressed | 0) <= 9) {
this.IOCore.joypad.keyPress(keyPressed | 0);
}
}
GameBoyAdvanceEmulator.prototype.keyUp = function (keyReleased) {
- console.log("keyup emulator");
- console.log(keyReleased);
-
-
keyReleased = keyReleased | 0;
if ((this.emulatorStatus | 0) < 0x10 && (keyReleased | 0) >= 0 && (keyReleased | 0) <= 9) {
this.IOCore.joypad.keyRelease(keyReleased | 0);
View
@@ -112,11 +112,9 @@ self.onmessage = function (event) {
break;
case 11:
Iodine.keyDown(data.payload | 0);
- console.log("keydown");
break;
case 12:
Iodine.keyUp(data.payload | 0);
- console.log("keyUp");
break;
case 13:
Iodine.incrementSpeed(+data.payload);
@@ -9,7 +9,6 @@
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
function keyDown(e) {
-
var keyCode = e.keyCode | 0;
for (var keyMapIndex = 0; (keyMapIndex | 0) < 10; keyMapIndex = ((keyMapIndex | 0) + 1) | 0) {
if ((IodineGUI.defaults.keyZonesGBA[keyMapIndex | 0] | 0) == (keyCode | 0)) {
@@ -1,35 +1,3 @@
-// if(annyang){
-
-// pressKeyFunctionConstructor = function(key){
-// key = key.toLowerCase()
-// var func = function(){
-// pressButton(key,20);
-// };
-// return func;
-// }
-
-// handleButton = function(key){
-// //lower case the key to ignore capitals
-// key = key.toLowerCase();
-// pressButton(key, 20);
-// }
-
-
-
-// var commands = {};
-
-// for (var key in mapButtontoIndex){
-// commands[key] = pressKeyFunctionConstructor(key);
-// }
-// commands["press (the) button *key"] = handleButton;
-// commands["press (the) key *key"] = handleButton;
-
-
-
-// // Add our commands to annyang
-// annyang.addCommands(commands);
-// annyang.start();
-// }
var mapButtontoIndex = {"a":0, "b":1, "select":2, "start":3, "right":4, "left": 5, "up":6 ,"down":7, "r":8, "l":9};
var SpeechRecognition = SpeechRecognition ||