Comments (2)
Scroll direction is usually an OS configuration option. I'm not sure how that is read/represented in Java.
from java-cef.
I have a proposal for a somewhat hacky solution
This is the code in X11Window
class responsible for making the mouse event.
if (xev.get_type() == XConstants.ButtonPress) {
MouseWheelEvent mwe = new MouseWheelEvent((Component)getEventSource(),MouseEvent.MOUSE_WHEEL, jWhen,
modifiers,
x, y,
xbe.get_x_root(),
xbe.get_y_root(),
1,false,MouseWheelEvent.WHEEL_UNIT_SCROLL,
3,button==4 ? -1 : 1);
postEventToEventQueue(mwe);
}
So when scrolling down normally the button passed is 5 and delta is positive, X11Window
does keep track of lastButton
so in the native code we could fetch that and just reverse this behavior on linux
Made a POC that works, its just working in the case for natural scrolling, we would have to do the opposite of getWheelRotation() to calculate the delta properly
jclass xWindow = env->FindClass("sun/awt/X11/XWindow");
jfieldID lastButtonId = env->GetStaticFieldID(xWindow, "lastButton", "J");
jlong button = env->GetStaticLongField(xWindow, lastButtonId);
// Would check against getWheelRotation
if (button == 5L) {
delta = -3;
} else {
delta = 3;
}
from java-cef.
Related Issues (20)
- libwebp chromium vulnerability HOT 1
- Load html directly HOT 4
- Unwanted behavior - Ctrl+Wheel zooms the whole window now HOT 1
- How to configure version of libc compiled against on Linux? HOT 2
- GPU Error on Linux Aarch64 HOT 2
- Upgrade to Chromium 119 HOT 1
- Add CefBrowserSettings
- New chromium vulnerabilities (
- Character encoding in CefResourceHandler HOT 2
- I am encountering this error when opening a webpage. Google Chrome and Microsoft Edge are both working fine. Please fix this bug officially.
- resort :The date input box is in English
- Hope PermissionHandler support HOT 1
- Closing not working as expected HOT 3
- 请问什么时候可以支持javafx21
- CefApp.getInstance: Passing a flag with two '=' instances fails
- Crash when creating new subprocess HOT 1
- Can you disclose the PID of CefClient so that the pid can be killed when the rendering process cannot be released normally?
- disable-web-security flag not working
- Display exceptions when the browser background is transparent
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from java-cef.