DPaint-js icon indicating copy to clipboard operation
DPaint-js copied to clipboard

Quit shortcut does not work when installed as an offline app

Open warpdesign opened this issue 9 months ago • 3 comments

When DPaint-js is installed as an app, pressing cmd+q (or alt-f4 on windows,...) should exit the app, but it does nothing.

Image

Note that the Quit DPaint.js entry menu works, but the shortcut does not.

warpdesign avatar Mar 22 '25 10:03 warpdesign

This is because of this line:

https://github.com/steffest/DPaint-js/blob/bea976c324f8649f8fe2747ae8af37322db1d8b1/_script/ui/input.js#L311

Shouldn't this be run only if the event has been handled by DPaint.js?

Commenting it makes the cmd+q shortcut (as well as others, like cmd+,) work as expected.

warpdesign avatar Mar 24 '25 08:03 warpdesign

well... sometimes it's not wanted to let the default browser behaviour go through. (For example Cmd-A should "select all" as a paint program; not "select all text" as the default browser behaviour is., Cmd-S should save the image, not the page, etc...) But as Cmd-Q currently is not in use for other things, we can (and should) let that through.

steffest avatar Mar 24 '25 09:03 steffest

I think it depends on the context, for example, when the user is editing a text input/text area, Cmd-A should follow the default browser behaviour. For example:

Image

That's why I was suggesting to prevent default behaviour only when the event is handler in DPaint.js.

warpdesign avatar Mar 24 '25 09:03 warpdesign