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

Mouse stuck in the middle of the overlay when toggled from a fps game #55

Open
Wurielle opened this issue Mar 12, 2021 · 1 comment
Open

Comments

@Wurielle
Copy link

Hey there! I have an issue that first occurred on my app once I tried to toggle input.intercept manually and after some digging realized it was reproducible with the demo as well.

Basically if a fps game is focused and I call the overlay to make it appear, the mouse is stuck at the center of the screen as if the game still had focus.

I assume that's because fps games recenter the mouse to the center of the screen for their own purpose but I didn't find a way to switch the focus to the overlay or a browser window properly to prevent that from happening so after many days of trial and error this is my last stop before I attempt another approach for my application. This is the only thing that keeps me from reaching my goal unfortunately.

To reproduce the issue:

  • Add global shortcuts to toggle the overlay
  • Inject the overlay into a fps game (I mostly tested on "Lovely Planet" and "ULTRAKILL")
  • Get into the game and shoot to make sure the window is focused
  • Toggle the overlay and you'll notice the cursor is stuck in the middle of the screen

-- Here's a gif of what's happening --
2021-03-13_00-06-21

Here's the code I added in app-entry.ts to toggle the overlay:

// line 1
import {app, BrowserWindow, globalShortcut, ipcMain} from "electron"
...
...
// line 12
app.on("ready", () => {
  globalShortcut.register("z", () => {
    IOverlay.sendCommand({
      command: "input.intercept",
      intercept: true
    })
  })

  globalShortcut.register("x", () => {
    IOverlay.sendCommand({
      command: "input.intercept",
      intercept: false
    })
  })
})

Thank you in advance if you manage to find some time to help ❤️

@hiitiger
Copy link
Owner

hiitiger commented Jul 1, 2021

ye, It's a problem. I need to make it compatible to each game case by case 🤣, so what api do you use to reset mouse position?

0xafbf pushed a commit to 0xafbf/goverlay that referenced this issue Nov 5, 2022
…n/client/typescript-eslint/eslint-plugin-2.34.0

Bump @typescript-eslint/eslint-plugin from 2.29.0 to 2.34.0 in /client
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

No branches or pull requests

2 participants