Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: keyboard shortcut to open app (with setting to disable) #1032

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

adufr
Copy link
Contributor

@adufr adufr commented Apr 17, 2024

Related issues

#995

Context

  • Add a keyboard shortcut to show/hide the app window without having to use the mouse/trackpad-
  • Also add a setting to enable/disable this shortcut

Discussion

  • I put the shortcut string in the settings even though this PR doesn't allow the shortcut to be customized (we can add that as another new feature later)
  • What do you think about the shortcut I've added by default ? (CmdOrCtrl+Alt+G)
  • Right now the shortcut is disabled by default, do you think we could/should enable it by default?

@adufr
Copy link
Contributor Author

adufr commented Apr 17, 2024

Hello @setchy, I've just opened this PR but in DRAFT as I'm having an issue I don't know how to solve, so I'd really appreciate some help on this 😁

Right now the feature/setting is working great, the only problem I have is, when you enable the shortcut setting, then close the app, then reopen it, the shortcut doesn't work -> you have to toggle the setting off and on for it to be registered again

I'm having trouble to make the React app that contains the state communicate with the Electron backend responsible for registering the shortcut

(PS: feel free to push some changes here if needed)

src/context/App.tsx Outdated Show resolved Hide resolved
@setchy
Copy link
Member

setchy commented Apr 18, 2024

@adufr - just ran this on my machine to get a feel for how this would work... i know this is still WIP, but sharing that on my device the shortcut briefly shows the window before it hides. i also get some other random artifact on another display at the same time 🤔

@adufr
Copy link
Contributor Author

adufr commented Apr 18, 2024

@adufr - just ran this on my machine to get a feel for how this would work... i know this is still WIP, but sharing that on my device the shortcut briefly shows the window before it hides. i also get some other random artifact on another display at the same time 🤔

That's really weird 🤨 I just tried it again and it works perfectly. I even tried it with a 4 monitors setup and no issue whatsoever...
And the code looks very clean so I really don't understand what could cause this

You're running MacOS right? Which version are you using? (I'm on 14.4.1)

@setchy
Copy link
Member

setchy commented Apr 18, 2024

Correct, macOS 14.4.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants