3

Some games and programs use the scroll wheel to scroll or zoom, but if the main window is large enough, this will usually scroll the browser window as well, which will put the game off of the screen.

Is there a way to stop this from happening?

Ideally, something would autodetect where the focus is and only apply the mouse wheel inputs to that space, but it would work almost as well for something to quickly disable scrolling and re-enable it later. Maybe the scroll lock button can be appropriated, not like it does anything else. It would be really cool to press scroll lock to disable scrolling and press it again to re-enable it.

I know there are ways to make a game so it doesn't scroll the window when focused; I'm trying to find a way to make it so ALL the games I play act like that.

3
  • This seems like the failure of the developer(s) to properly implement that feature.. Have you tried different browsers? Different browsers often require different code to accomplish the same feature (though I'm not sure if this is true in Flash...) May 24, 2016 at 11:11
  • It doesn't seem to be a browser-based problem, though I'm guessing the solution will be browser based. I generally use Chrome, but if the solution was Firefox or IE only for some reason, I'd be okay with using them for certain things. May 24, 2016 at 11:18
  • I found this question in the SU homepage because it was bumped by community. It's very likely that what caused the problem and what could be the solution at that time is no longer happening / will not work on 2023.
    – Wicket
    Feb 6, 2023 at 16:57

2 Answers 2

0

I was dealing with this exact problem while trying to play this flash game on armorgames.com (yea, I know, Flash is decomming in 2 days. Please don't rub it in).

Basically, the game allows you to switch between weapons with the scroll wheel, but the webpage is so large that the browser scrollbar appears and the whole page scrolls up/down whenever you try using the scroll wheel to switch weapons.

Solution:

To fix this, I used a bookmarklet that runs some code to toggle the scrollbar 'off' when I'm playing the game. (After I'm done playing, I can run the same bookmarklet and it will turn the scrollbar back on).

javascript:(()=>{document.body.style.overflowY=document.body.style.overflowY===''?'hidden':''})();

Explanation:

The bookmarklet is using a ternary operator to toggle the hidden property of the overflowY attribute on the style of the <body> tag element in the webpage's HTML.

document.body.style.overflowY = document.body.style.overflowY === '' ? 'hidden' : ''

If the overflowY style is not set on the body tag, it will set that style to hidden. Otherwise, it will remove that style.

Usage:

Create a random bookmark, name it something like 'Toggle browser scrollbar', and then paste the entire line of code in the 'Solution' section above into the 'URL' box of the bookmark. Go to the webpage where you want to disable the browser scrollbar, scroll the browser to the position where you want it to freeze, and then click on the bookmarklet you created. (If you want the scrollbar to reappear, just click the same bookmarklet again)

-2

If your using windows 10, turn off inactive scrolling. settings>devices>mouse and touchpad

There's an option there to "Scroll inactive windows when I hover over them"

enter image description here

Turn this off

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .