File tree Expand file tree Collapse file tree 2 files changed +1
-20
lines changed Expand file tree Collapse file tree 2 files changed +1
-20
lines changed Original file line number Diff line number Diff line change @@ -95,8 +95,7 @@ function keyboard(p5, fn){
95
95
* </code>
96
96
* </div>
97
97
*/
98
- fn . isKeyPressed = false ;
99
- fn . keyIsPressed = false ; // khan
98
+ fn . keyIsPressed = false ;
100
99
101
100
/**
102
101
* A `String` system variable that contains the value of the last key typed.
@@ -444,7 +443,6 @@ function keyboard(p5, fn){
444
443
// prevent multiple firings
445
444
return ;
446
445
}
447
- this . isKeyPressed = true ;
448
446
this . keyIsPressed = true ;
449
447
this . keyCode = e . which ;
450
448
this . _downKeys [ e . which ] = true ;
@@ -617,7 +615,6 @@ function keyboard(p5, fn){
617
615
this . _downKeys [ e . which ] = false ;
618
616
619
617
if ( ! this . _areDownKeys ( ) ) {
620
- this . isKeyPressed = false ;
621
618
this . keyIsPressed = false ;
622
619
}
623
620
Original file line number Diff line number Diff line change @@ -38,22 +38,6 @@ suite('Keyboard Events', function() {
38
38
} ) ;
39
39
} ) ;
40
40
41
- suite ( 'p5.prototype.isKeyPressed' , function ( ) {
42
- test ( 'isKeyPressed should be a boolean' , function ( ) {
43
- assert . isBoolean ( myp5 . isKeyPressed ) ;
44
- } ) ;
45
-
46
- test ( 'isKeyPressed should be true on key press' , function ( ) {
47
- window . dispatchEvent ( new KeyboardEvent ( 'keydown' ) ) ;
48
- assert . strictEqual ( myp5 . isKeyPressed , true ) ;
49
- } ) ;
50
-
51
- test ( 'isKeyPressed should be false on key up' , function ( ) {
52
- window . dispatchEvent ( new KeyboardEvent ( 'keyup' ) ) ;
53
- assert . strictEqual ( myp5 . isKeyPressed , false ) ;
54
- } ) ;
55
- } ) ;
56
-
57
41
suite ( 'p5.prototype.key' , function ( ) {
58
42
test ( 'key should be a string' , async function ( ) {
59
43
window . dispatchEvent ( new KeyboardEvent ( 'keydown' , { key : 's' } ) ) ;
You can’t perform that action at this time.
0 commit comments