aframevr / aframe-inspector

:mag: Visual inspector tool for A-Frame. Hit *<ctrl> + <alt> + i* on any A-Frame scene.
https://aframe.io/aframe-inspector/examples/
MIT License
654 stars 201 forks source link

Wrong keyboard shortcut for MacOS #600

Closed mattrossman closed 1 year ago

mattrossman commented 4 years ago

The documented shortcut of Ctrl+Alt+I (which could be interpreted as Ctrl+Option+I or Cmd+Option+I) does not work on MacOS, tested on Firefox and Chrome. I thought that the inspector was simply broken. I found out on StackOverflow that instead, the shortcut for MacOS is Shift+Ctrl+Option+I.

I don't know if the "issue" is the shortcut implementation or lack of documentation, but either way it's mind boggling that this basic operation has not been documented for the MacOS community. Editing this to be less sassy 😅

mattrossman commented 3 years ago

Bumping this to note that Shift+Option+I now seems to be sufficient, but it still needs to be documented.

dmarcos commented 3 years ago

PRs always appreciated https://github.com/aframevr/aframe/blob/master/docs/introduction/visual-inspector-and-dev-tools.md

mattrossman commented 3 years ago

@dmarcos Is there a reason for having a separate shortcut on MacOS? I notice the shortcut is mentioned in several places in the docs -- rather than mentioning the alternate shortcut every time, maybe we can fix the shortcut to be the same across platforms?

dmarcos commented 3 years ago

The shortcut should be the same in both platforms. The equivalent of the alt key on the mac is the option key. Shortcut should be:

Unless the Mac shortcut is taken for something else.

The idea of the inspector is to be the 3D equivalent of the DOM inspector that opens with Ctrl + Shift + i

Logic is in A-Frame not in the inspector repo.

kfarr commented 1 year ago

ctl + option + i has opened a-frame inspector on mac os for the last decade, @dmarcos can you close this?

mattrossman commented 1 year ago

I gotchu. I actually still face this issue but it's not A-Frame's fault.

Unless the Mac shortcut is taken for something

This was the cause for me. It seems Ctrl + Option + i is a shortcut used by a couple other popular Mac applications. I don't recall which app was causing the conflict originally, but there wasn't any visual feedback so it appeared to be doing nothing. More recently I experience the conflict with the default keybinds for Rectangle, but that one is easier to notice since it causes a window snap.

Interestingly, I only need to press Option + i on Mac to summon the inspector. The line Diego shared above will ignore the evt.ctrlKey check as long as evt.getModifierState('AltGraph') is satisfied, which on Mac happens when Option is pressed (reference).

kfarr commented 1 year ago

@mattrossman thanks for the writeup, sorry I came off as rude in my request to close, I was going through a bunch of old tickets that were very similar. Appreciate the context and helpful to know about traps like this when helping users open the inspector.

KokoDoko commented 3 months ago

Sadly this issue still persists. Even after closing other mac apps that use the same shortcut / or changing the shortcuts in other mac apps. I'm sure I am missing some app, but in the mean time, Is there another way to open the a-frame inspector on mac?

dmarcos commented 3 months ago

@vincentfretin cc

vincentfretin commented 3 months ago

I don't have a mac to test. @kfarr seems to say it works correctly on macOS.

mattrossman commented 3 months ago

@KokoDoko The following work on my Mac:

Interestingly the workaround key combos I mentioned earlier here and here no longer work for me.

I have Rectangle installed which conflicts with the usual shortcut, typically some combination of modifier keys plus i does the trick for opening inspector

https://github.com/aframevr/aframe-inspector/assets/22670878/32f46db6-32fa-4d7d-b697-c4f7aac46154