@@ -5382,14 +5382,18 @@ class KeyboardManager {
53825382 if ( ! this . keysDown . includes ( event . key ) ) {
53835383 this . keysDown . push ( event . key )
53845384 }
5385+ const key = event . key . toUpperCase ( )
53855386 if ( ( event . ctrlKey || event . metaKey ) && ! event . altKey ) {
5386- const key = event . key . toUpperCase ( )
53875387 // Redo: Ctrl + Y, or Ctrl + Shift + Z
53885388 if ( ( key === 'Y' && ! event . shiftKey ) || ( key == 'Z' && event . shiftKey ) ) {
53895389 this . messageBroker . publish ( 'redo' )
53905390 } else if ( key === 'Z' && ! event . shiftKey ) {
53915391 this . messageBroker . publish ( 'undo' )
53925392 }
5393+ } else if ( key == '[' && ! event . shiftKey ) {
5394+ adjustBrushSize ( - 4 )
5395+ } else if ( key == ']' && ! event . shiftKey ) {
5396+ adjustBrushSize ( 4 )
53935397 }
53945398 }
53955399
@@ -5505,13 +5509,17 @@ app.registerExtension({
55055509 id : 'Comfy.MaskEditor.BrushSize.Increase' ,
55065510 icon : 'pi pi-plus-circle' ,
55075511 label : 'Increase Brush Size in MaskEditor' ,
5508- function : ( ) => changeBrushSize ( ( old ) => _ . clamp ( old + 4 , 1 , 100 ) )
5512+ function : ( ) => {
5513+ adjustBrushSize ( 4 )
5514+ }
55095515 } ,
55105516 {
55115517 id : 'Comfy.MaskEditor.BrushSize.Decrease' ,
55125518 icon : 'pi pi-minus-circle' ,
55135519 label : 'Decrease Brush Size in MaskEditor' ,
5514- function : ( ) => changeBrushSize ( ( old ) => _ . clamp ( old - 4 , 1 , 100 ) )
5520+ function : ( ) => {
5521+ adjustBrushSize ( - 4 )
5522+ }
55155523 }
55165524 ] ,
55175525 init ( ) {
@@ -5526,6 +5534,10 @@ app.registerExtension({
55265534 }
55275535} )
55285536
5537+ const adjustBrushSize = async ( amount : number ) => {
5538+ changeBrushSize ( ( oid ) => _ . clamp ( oid + amount , 1 , 100 ) )
5539+ }
5540+
55295541const changeBrushSize = async ( sizeChanger : ( oldSize : number ) => number ) => {
55305542 if ( ! isOpened ( ) ) return
55315543 const maskEditor = MaskEditorDialog . getInstance ( )
0 commit comments