@@ -443,11 +443,28 @@ pzpr.classmgr.makeCommon({
443443 ) {
444444 this . inputMode = mode ;
445445 this . savedInputMode [ this . puzzle . editmode ? "edit" : "play" ] = mode ;
446+ this . autohide_cursor ( ) ;
446447 this . puzzle . redraw ( ) ;
447448 } else {
448449 throw Error ( "Invalid input mode: " + mode ) ;
449450 }
450451 } ,
452+ autohide_cursor : function ( ) {
453+ if (
454+ this . inputMode . startsWith ( "number" ) ||
455+ this . inputMode . startsWith ( "letter" )
456+ ) {
457+ this . cursor . isActive = true ;
458+ } else if ( this . inputMode !== "auto" ) {
459+ this . cursor . isActive = false ;
460+ } else if ( this . puzzle . editmode ) {
461+ this . cursor . isActive = true ;
462+ } else if ( this . cursor . disableAnum ) {
463+ this . cursor . isActive = false ;
464+ }
465+
466+ this . cursor . draw ( ) ;
467+ } ,
451468 getInputModeList : function ( type ) {
452469 if ( this . puzzle . instancetype === "viewer" ) {
453470 return [ ] ;
@@ -611,12 +628,14 @@ pzpr.classmgr.makeCommon({
611628 setcursor : function ( pos ) {
612629 var pos0 = this . cursor . getaddr ( ) ;
613630 this . cursor . setaddr ( pos ) ;
631+ this . cursor . isActive = true ;
614632 pos0 . draw ( ) ;
615633 pos . draw ( ) ;
616634 } ,
617635 setcursorsnum : function ( pos ) {
618636 var pos0 = this . cursor . getaddr ( ) ;
619637 this . cursor . setaddr ( pos ) ;
638+ this . cursor . isActive = true ;
620639 var target ;
621640 var bx = this . inputPoint . bx ,
622641 by = this . inputPoint . by ;
0 commit comments