-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathmain.js
32 lines (25 loc) · 1006 Bytes
/
main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// window.onload = function() {
// console.log("hello")
// //start the webgazer tracker
// webgazer.setRegression('ridge') /* currently must set regression and tracker */
// .setTracker('clmtrackr')
// .setGazeListener(function(data, clock) {
// //console.log(data); /* data is an object containing an x and y key which are the x and y prediction coordinates (no bounds limiting) */
// // console.log(clock); /* elapsed time in milliseconds since webgazer.begin() was called */
// })
// .begin()
// .showPredictionPoints(true); /* shows a square every 100 milliseconds where current prediction is */
// }
var myMap = new Map();
function addToMap(string, func)
{
myMap.set(string,func);
}
document.onkeypress = function(e) {
if(e.key == ' ')
{
let hovered = document.getElementsByClassName("hover")[0];
func = myMap.get(hovered.id.toString());
func();
}
}