-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathExample.html
More file actions
27 lines (24 loc) · 837 Bytes
/
Example.html
File metadata and controls
27 lines (24 loc) · 837 Bytes
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
<!DOCTYPE html>
<html>
<!-- Copyright (C) 2015 Benjamin Dahl Mikkelsen -->
<head>
<title>Ben Key Demo</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script>
<script src="BenKeyLibrary.js"></script>
<style>
</style>
</head>
<body>
<h1 id="displayText">Last key pressed: </h1>
<script>
ben.settings.consoleLogEvents = false;
function benKeyPressed(key, code){
document.getElementById("displayText").innerHTML = "Last key pressed: " + ben.keysHeld.toString();
}
function benKeyLifted(key, code){
document.getElementById("displayText").innerHTML = "Last key pressed: " + ben.keysHeld.toString();
}
</script>
</body>
</html>
</!DOCTYPE>