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

Plugin fails to connect #8

Open
lovettbarron opened this issue Mar 12, 2021 · 11 comments
Open

Plugin fails to connect #8

lovettbarron opened this issue Mar 12, 2021 · 11 comments
Labels
figma help wanted Extra attention is needed mac os

Comments

@lovettbarron
Copy link

Incredibly stoked for this plugin, however it fails to connect. I don't see anything in the console that seems useful for debugging.

Screen Shot 2021-03-12 at 20 39 56

@chuanqisun chuanqisun added help wanted Extra attention is needed mac os labels Mar 20, 2021
@chuanqisun
Copy link
Owner

Hey @readywater, big thanks for trying to help! I don't have a mac device so it's extremely difficult for me to debug and reproduce this issue. I saw you have some JavaScript experience so I wonder if you can help me collect some information to debug:

  • Make sure your SpaceMouse connected and active
  • Go to a chrome browser (no need to be in Figma) and dump the connected gamepad devices ids to the console using this script.
console.log([...navigator.getGamepads()].map(gamepad => (gamepad.id)))
  • If the output is blank or error, try it a few more times while jittering the knob. Sometimes the device must "wake up" the browser first.

The expected output should look like this:
image

Once do you this, we can figure out next steps.

Thank you again.

@chuanqisun
Copy link
Owner

Hi @readywater, please let me know if you are still experiencing the same issue and whether you'd be willing to help collect some diagnostics as mentioned above. I'm closing the issue for now. Just let me know if I need to re-open it.

Thanks again!

@bimawa
Copy link

bimawa commented Sep 15, 2021

@chuanqisun I'm here for help. After update on BigSure this, awesome, plugin didn't work anymore :( I'm crying. Tears can't help grief.
So, this is what got:
CleanShot 2021-09-15 at 14 44 23@2x

@bimawa
Copy link

bimawa commented Sep 16, 2021

CleanShot 2021-09-16 at 12 09 50@2x

@chuanqisun chuanqisun reopened this Sep 17, 2021
@chuanqisun
Copy link
Owner

chuanqisun commented Sep 17, 2021

Thank you @bimawa for the update! A bit of background:

This plugin uses the browser's "gamepad" api to detect 3Dconnexion device. Even though SpaceMouse is not technically a "gamepad", it should still show up in the browser's gamepad device list, at least in the past versions of macOS and all versions of Windows. So we are exploiting the browser as the driver.

Based on your console log, it appears that the device is not detected by the browser. Could you help try 2 more things?

  1. There is a similar project that uses the same technique. Just to rule out any bug in my implementation, could you try these demos and see if you SpaceMouse works? (make sure to jiggle the device a few times to activate it)
    1 .THREE.js
    2. A-Frame Component
    3. A-Frame Inspector
  2. With the device connected and active, could you copy, paste, and enter this javascript in the browser console and see what the results are? If possible, try it in a few different browsers.
    navigator.getGamepads()

I found another listed for reference:
Chrome browser support on OS X Big Sur
Re: Use 3DConnexion mouse as 2D

These made me think the beta driver caused the device to disappear from the gamepad list. I also replied in the forum to see if the device vendor is willing to provide a driver fix on their side.

If you want to, you can try uninstall the beta driver. (Just as a proof of concept. I don't expect people to uninstall the beta driver in order to use this Figma plugin).

Attaching the support forum thread for reference:
https://forum.3dconnexion.com/viewtopic.php?f=23&t=39825&p=82487&hilit=gamepad#p82487

@bimawa
Copy link

bimawa commented Sep 22, 2021

@chuanqisun

  1. gamepads still not found:
  • chrome:

CleanShot 2021-09-22 at 09 46 13@2x

- vivaldi:

CleanShot 2021-09-22 at 09 47 13

  1. I think problem not in browsers. This is drivers or plugins from 3dConnexion.
  2. I can't use stable driver on Big Sur. It doesn't exist yet. Older drivers didn't work on big sur.

I think we should request from 3dconnexion supports to developers.

@chuanqisun
Copy link
Owner

Thanks for further testing. 3DConnexion also replied in the support forum. Looks like it's a macOS 11 quirk that forced them to change the driver behavior to have an "exclusive grab" of the device, hence making it invisible to the browser.

I'll keep this issue open. We can track the status in the support forum thread: https://forum.3dconnexion.com/viewtopic.php?f=23&t=39825&p=82487&hilit=gamepad#p82522

I've requested more details in that thread. If anyone is impacted by this issue, please reply in the 3DConnexion forum so we can get this prioritized.

@chevdor
Copy link

chevdor commented Feb 8, 2022

Hello, I am facing the same issue and found this issue.
I tested the 3 similar projects and none of them detects any gamepad.
I testing using Brave (so close to Chromium) while having all shields down.

@chevdor
Copy link

chevdor commented Jun 13, 2022

FYI I tried again, but in Chrome this time. Still now success:
image

However, after trzing the following:

Then revisiting the same browsers (tested with Chrome and Brave):
Chrome:
image

Brave:
image

🎉

So I suspect there is soemthing that triggers loading the gampads that including in one or both the demos I linked and that should be called to ensure the browser does grab the 3dmouse as gamepad.

@chevdor
Copy link

chevdor commented Jun 13, 2022

I then tried figma in a browser, it did not work.
I then opened the plugins settings and while the plugin settings popup is open, the 3dmouse does respond.
As soon as I close the popup, it stops working again.

image

Here is a call from the context of the devtools in the popup and then in figma:
image

@chevdor
Copy link

chevdor commented Jun 13, 2022

Here is what may be helpful:
image

VM1235:80 getGamepad will now require Secure Context. Please update your application accordingly. For more information see https://github.com/w3c/gamepad/pull/120

VM1235:80 getGamepad will now require a Permission Policy. Please update your application accordingly. For more information see https://github.com/w3c/gamepad/pull/112

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
figma help wanted Extra attention is needed mac os
Projects
None yet
Development

No branches or pull requests

4 participants