File tree 1 file changed +10
-7
lines changed
1 file changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -636,6 +636,15 @@ function keyboard(p5, fn){
636
636
* </div>
637
637
*/
638
638
fn . _onkeyup = function ( e ) {
639
+
640
+ const context = this . _isGlobal ? window : this ;
641
+ if ( typeof context . keyReleased === 'function' ) {
642
+ const executeDefault = context . keyReleased ( e ) ;
643
+ if ( executeDefault === false ) {
644
+ e . preventDefault ( ) ;
645
+ }
646
+ }
647
+
639
648
delete this . _downKeyCodes [ e . code ] ;
640
649
delete this . _downKeys [ e . key ] ;
641
650
@@ -652,15 +661,9 @@ function keyboard(p5, fn){
652
661
this . key = lastPressedKey ;
653
662
}
654
663
655
- const context = this . _isGlobal ? window : this ;
656
- if ( typeof context . keyReleased === 'function' ) {
657
- const executeDefault = context . keyReleased ( e ) ;
658
- if ( executeDefault === false ) {
659
- e . preventDefault ( ) ;
660
- }
661
- }
662
664
} ;
663
665
666
+
664
667
/**
665
668
* A function that's called once when keys with printable characters are pressed.
666
669
*
You can’t perform that action at this time.
0 commit comments