-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkeypressed.html
38 lines (33 loc) · 876 Bytes
/
keypressed.html
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
33
34
35
36
37
38
<link rel="shortcut icon" type="image/jpg" href="favicon.jpg"/>
<link rel="stylesheet" href="style.css"><link>
<html>
<head>
<title>keypressed</title>
<div>
<!-- Load the Processing.js library -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/processing.js/1.6.0/processing.min.js"></script>
<body>
<h2>press any key <h2>
<h5>sorry, phone users-- this wont work<h5>
<h2><a href = index.html>back</a></h1>
<h2><a href = keypressedSC.html>code</a></h1>
<script type="application/processing">
void setup(){
size(1000,1000);
}
void draw(){
background(255,255,255);
fill(0,0,0);
textSize(80);
if(keyPressed == true){
text("Key being held", 250,500);
}
if(keyPressed == false){
text("Key not being held", 175, 500);
}
text(key, 500, 400);
}
</script>
<canvas> </canvas>
</body>
</html>