Disable touchpad zooming in JcefBrowser
Planned
Hi, I managed to disable zooming triggered by Ctrl + MouseWheel in JcefBrowser through
jbCefBrowser.getComponent().addMouseWheelListener(e -> {
if (e.isControlDown()) {
jbCefBrowser.getCefBrowser().setZoomLevel(0.0);
e.consume(); // Consume the event to prevent zooming
}
});
But the touchpad event won't trigger this listener, how can I disable the touchpad zooming event?
And I find the page jiggles when I use ctrl + mousewheel, Is there a better method to lock the scale?
Thank you very much for any help!
Please sign in to leave a comment.
Hi,
It's the windowed mode(not OSR)? Right?
Unfortunately there is no JCEF API that could help to do that.
But I can suggest to use JavaScript to disable zooming, if you can inject some JS into your page.
You may also just execute this JS code once the browser loaded the page, if it doesn't break the page logic.