File tree Expand file tree Collapse file tree 1 file changed +10
-7
lines changed
Expand file tree Collapse file tree 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){
636636 * </div>
637637 */
638638 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+
639648 delete this . _downKeyCodes [ e . code ] ;
640649 delete this . _downKeys [ e . key ] ;
641650
@@ -652,15 +661,9 @@ function keyboard(p5, fn){
652661 this . key = lastPressedKey ;
653662 }
654663
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- }
662664 } ;
663665
666+
664667 /**
665668 * A function that's called once when keys with printable characters are pressed.
666669 *
You can’t perform that action at this time.
0 commit comments