Disable touchpad zooming in JcefBrowser
已计划
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!
请先登录再写评论。
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.