TheGoddessInari / hamsket

Free and Open Source messaging and emailing app that combines common web applications into one.
GNU General Public License v3.0
882 stars 54 forks source link

Navigation between apps using shortcut keys #137

Open vraravam opened 5 years ago

vraravam commented 5 years ago

Mainly, I try to navigate using keyboard shortcuts and avoid the use of the trackpad.

Steps to reproduce

  1. Install the latest nightly of hamsket on mac OS
  2. Setup 2 or more applications
  3. Press Cmd + 1 or Cmd + 2

Expected behavior

Cmd + should take the user to that configured application. This is the normal way to traverse multiple tabs in any browser on MacOS

Actual behavior

Nothing happens

ENVIRONMENT

Hamsket: v0.6.0

OS: darwin (x64)

Arch: x64

BuildVersion: ce44d75 (grafted, HEAD, tag: nightly, origin/master) Tue, 29 Oct 2019 10:11:03 -0700

Does this happen upstream: unknown

TheGoddessInari commented 4 years ago

This has been implemented for a very long time.

Eg,

                        {
                            label: `Goto Tab 1`,
                            accelerator: 'CmdOrCtrl+1',
                            click() {
                                sendAction('focusTab', 1);
                            }
                        },

If there's a Mac problem here, it's probably in Electron. Try the latest nightly build (with Electron 7.1.4).

If I'm missing something obvious here, I'm happy to fix it.

TheGoddessInari commented 4 years ago

No response received on this, and the accelerators should be working fine.

kyds3k commented 4 years ago

This is not working for me - just installed for the first time. Version: 0.6.0 Platform: darwin (x64) Electron: 8.1.1 Chromium: 80.0.3987.141 Node: 12.13.0 BuildVersion: 8871b6c (grafted, HEAD, tag: nightly, origin/master) Sat, 14 Mar 2020 10:07:20 -0700

TheGoddessInari commented 4 years ago

I have no way to test on MacOS, so likely someone will have to figure out what does and doesn't work, because literally the whole point of CmdOrCtrl is for it to use Cmd on MacOS and Ctrl on everything else, and that's provided by Electron.

sievertz commented 4 years ago

Same here, not working for me. Any troubleshooting we can do to figure it out? Version: 0.6.0 Platform: darwin (x64) Electron: 8.1.1 Chromium: 80.0.3987.141 Node: 12.13.0 BuildVersion: 298af38 (grafted, HEAD, tag: nightly, origin/master) Thu, 2 Apr 2020 15:44:54 -0700

vraravam commented 4 years ago

@TheGoddessInari : This is still a dealbreaker for me. Just tried to switch between 2 services. I'm using:

Version: 0.6.0
Platform: darwin (x64)
Electron: 9.1.2
Chromium: 83.0.4103.122
Node: 12.14.1
BuildVersion: 249264e (grafted, HEAD, tag: nightly, origin/master) Fri, 31 Jul 2020 00:37:43 -0700
dzg commented 4 years ago

Also on Mac 0.6.0 -- and not able to switch apps with any keys

dzg commented 4 years ago

FWIW ... doesn't work in v 0.5.20 either

vraravam commented 3 years ago

@TheGoddessInari - is there a debug log or something that we can retrieve and attach to this ticket - to help you debug the issue? This definitely doesn't work on MacOS. I tried with a vanilla install on a fresh machine as well. No luck.

vraravam commented 3 years ago

Closing this issue since I have moved onto Ferdi.

vraravam commented 2 years ago

@TheGoddessInari - I think I have solved the same issue (while contributing to Ferdi). Please see this function: https://github.com/vraravam/ferdi/blob/develop/src/environment.ts#L28

The issue with electron on macos, is that, depending on whether you are using that CmdOrCtrl for an accelerator or for a menu item, the value needs to be different. You can follow the logic in the Ferdi codebase (as an example here: https://github.com/vraravam/ferdi/blob/develop/src/components/services/tabs/TabItem.js#L365) - almost all other invocations are done for the shortcut accelerator, whereas in this line, its for the display, and thus the parameter is false.

I hope this fixes the issue - I will be glad to test this (I'm thinking of moving to Hamsket, and if you can help with the initial setup, I can also start contributing to Hamsket as a contributor)

vraravam commented 2 years ago

Now that I am trying to contribute to Hamsket codebase, I was able to setup my laptop to successfully build it.

I am still facing the same issue on macos 12.1 and the latest codebase (HEAD of the master branch as of right now). Reopening the ticket.

vraravam commented 2 years ago

Found the issue: https://github.com/vraravam/hamsket/blob/master/electron/menu.js#L180 - if I remove this line, the shortcuts work on macos