diff --git a/frontend/src/features/canvas/components/IAICanvasToolbar/IAICanvasToolChooserOptions.tsx b/frontend/src/features/canvas/components/IAICanvasToolbar/IAICanvasToolChooserOptions.tsx index f32fcf04d3..48a7a78d14 100644 --- a/frontend/src/features/canvas/components/IAICanvasToolbar/IAICanvasToolChooserOptions.tsx +++ b/frontend/src/features/canvas/components/IAICanvasToolbar/IAICanvasToolChooserOptions.tsx @@ -86,7 +86,7 @@ const IAICanvasToolChooserOptions = () => { ); useHotkeys( - ['['], + ['BracketLeft'], () => { dispatch(setBrushSize(Math.max(brushSize - 5, 5))); }, @@ -98,7 +98,7 @@ const IAICanvasToolChooserOptions = () => { ); useHotkeys( - [']'], + ['BracketRight'], () => { dispatch(setBrushSize(Math.min(brushSize + 5, 500))); }, @@ -109,6 +109,40 @@ const IAICanvasToolChooserOptions = () => { [brushSize] ); + useHotkeys( + ['shift+BracketLeft'], + () => { + dispatch( + setBrushColor({ + ...brushColor, + a: _.clamp(brushColor.a - 0.05, 0.05, 1), + }) + ); + }, + { + enabled: () => true, + preventDefault: true, + }, + [brushColor] + ); + + useHotkeys( + ['shift+BracketRight'], + () => { + dispatch( + setBrushColor({ + ...brushColor, + a: _.clamp(brushColor.a + 0.05, 0.05, 1), + }) + ); + }, + { + enabled: () => true, + preventDefault: true, + }, + [brushColor] + ); + const handleSelectBrushTool = () => dispatch(setTool('brush')); const handleSelectEraserTool = () => dispatch(setTool('eraser')); const handleSelectColorPickerTool = () => dispatch(setTool('colorPicker')); diff --git a/frontend/src/features/system/components/HotkeysModal/HotkeysModal.tsx b/frontend/src/features/system/components/HotkeysModal/HotkeysModal.tsx index d500cc06ab..0bd7be796d 100644 --- a/frontend/src/features/system/components/HotkeysModal/HotkeysModal.tsx +++ b/frontend/src/features/system/components/HotkeysModal/HotkeysModal.tsx @@ -158,6 +158,16 @@ export default function HotkeysModal({ children }: HotkeysModalProps) { desc: 'Increases the size of the canvas brush/eraser', hotkey: ']', }, + { + title: 'Decrease Brush Opacity', + desc: 'Decreases the opacity of the canvas brush', + hotkey: 'Shift + [', + }, + { + title: 'Increase Brush Opacity', + desc: 'Increases the opacity of the canvas brush', + hotkey: 'Shift + ]', + }, { title: 'Move Tool', desc: 'Allows canvas navigation',