stretchly icon indicating copy to clipboard operation
stretchly copied to clipboard

[Feature request]: block "command + Q" Shortcut during break.

Open iwillhappy1314 opened this issue 3 years ago • 6 comments

Version

  • [X] I'm using version 1.7.0

Existing requests

  • [X] I've checked Existing requests

What operating system are you using?

macOS

Operating System Version

11.4 (20F71)

Problem description

When Break started, I can quite the break by "Command + Q" Shortcut, if we can block the "Command + Q" shortcut in Strict Mode, we can forced to have a rest.

Possible solution

When break start, register a global shortcut: "Command + Q" with empty callback, and unregister it when break complete.

Alternative solutions

Block keyboard event?

Additional information

No response

Code of Conduct

  • [X] I agree to follow this project's Code of Conduct

iwillhappy1314 avatar Jul 07 '21 15:07 iwillhappy1314

I've tried to register the shortcut and it worked, but I am not sure about this, as it breaks the current behavior (of app other than Stretchly):

Let's say you run Signal and you do whatever in it. When break starts and you hit Cmd+Q, Stretchly is not closed but Signal (as Stretchly is not taking focus). One has to first click on break window to Quit Stretchly with Cmd+Q.

Other option would be to set Stretchly's app menu in a way that Cmd+Q is not doing anything across the app. But then, in let's say Preferences, one could not quit app via it.

hovancik avatar Jul 08 '21 08:07 hovancik

How to block command+Tab shortcut? it make stretchly looks like a lock screen application.

nkbai avatar Jul 14 '21 09:07 nkbai

I am not sure whether that's possible as it is OS-level shortcut.

hovancik avatar Jul 14 '21 11:07 hovancik

I've tried to register the shortcut and it worked, but I am not sure about this, as it breaks the current behavior (of app other than Stretchly):

Let's say you run Signal and you do whatever in it. When break starts and you hit Cmd+Q, Stretchly is not closed but Signal (as Stretchly is not taking focus). One has to first click on break window to Quit Stretchly with Cmd+Q.

Other option would be to set Stretchly's app menu in a way that Cmd+Q is not doing anything across the app. But then, in let's say Preferences, one could not quit app via it.

According to my test, on my Mac, when the break starts, Stretchly preempts the Cmd+Q shortcut key, which is invalid in other applications.

iwillhappy1314 avatar Jul 14 '21 14:07 iwillhappy1314

According to my test, on my Mac, when the break starts, Stretchly preempts the Cmd+Q shortcut key, which is invalid in other applications.

@iwillhappy1314 can you explain? not sure what you mean.

hovancik avatar Jul 15 '21 07:07 hovancik

        breakWinLocal.on('close', (e) => {
            if (settings.get('showBreaksAsRegularWindows')) {
                if (!appIsQuitting && !breakWinLocal.fullScreen) {
                    e.preventDefault()
                }
            }
        })

nkbai avatar Jan 24 '22 07:01 nkbai