From eb776ca75ab3cbd5b3a901a17bc85c7ee965edb2 Mon Sep 17 00:00:00 2001 From: Tai Groot Date: Sat, 16 Jan 2016 10:55:50 -0800 Subject: [PATCH] Update custom.js --- custom.js | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/custom.js b/custom.js index e69de29..23d8137 100644 --- a/custom.js +++ b/custom.js @@ -0,0 +1,25 @@ +addShortcut(function(){ + console.log("You pressed the keys Control, X, and Enter."); +},[key.CTRL,key.X,key.ENTER]); + +addShortcut(function(){ + console.log("You pressed 1, 2, and 4 at the same time."); +},[key.ONE, key.TWO, key.FOUR]); +//keep in mind that alert() blocks the keyup event, so if you have problems, include the followingin your code: +//to release all keys: + +addShortcut(function(){ + alert("You pressed the keys Control, Y, and Enter."); + for(var i=0;i< keyStrokes.length;i++) + { + keyStrokes[i] = false; + } +},[key.CTRL,key.Y,key.ENTER]); +//This may not be desireable, as the user might still have keys pressed on the keyboard, and this would require the user to let up all keys. +//It might be better to only release one key: +addShortcut(function(){ + alert("You pressed the keys 1, 2, and 3."); + keyStrokes[key.ONE] = false; + keyStrokes[key.TWO] = false; + keyStrokes[key.THREE] = false; +},[key.ONE,key.TWO,key.THREE]);