![]() Sudo gedit /usr/share/x11//*nfĪdd the following text to the bottom of the file: Edit the nf file by running the following command and pressing Enter ( Figure 2):.But I think it could raises new issues like “What if the position given by x11 is outside the window, and then the use click on a mouse button? Will the window loose focus?” (this kind of thing).Īnyway.NOTE: Your Id number is different as each computer pulls and assigns the ids differently. In GLFW_CURSOR_DISABLED mode, glfw should reset the mouse to the last know position gave by x11, instead of recentering it in the middle of the window. This leads to the issue I faced at the beginning. So for the next events, the delta will be computed between and (and it will be done everytime). However, since we are in GLFW_CURSOR_DISABLED mode, glfw will always recenter the mouse (center of the window). It seems x11 is using so kind of depth because changing the last factor from 1 to 2 will give different result) (Don’t ask for the real computation, because I have not idea. This would correspond to the 0.5 scale factor we applied with xinput. ![]() Using non uniform matrix `xinput -set-prop 12 140 0.5 0 0 0 0.5 0 0 0 1 `Īnd it always gives which is around half of the previous results. When recieving a MotionNotify event, we print the values of const int x = event->xmotion.x // x position of the cursor for x11Ĭonst int y = event->xmotion.y // y position of the cursor for x11Īnd it always gives which is logic because glfw always re-center the mouse after polling x11 events (so half of the window size we gave at the beginning). Using uniform matrix `xinput -set-prop 12 140 1 0 0 0 1 0 0 0 1` Altered source versions must be plainly marked as such, and must not in a product, an acknowledgment in the product documentation would claim that you wrote the original software. The origin of this software must not be misrepresented you must not freely, subject to the following restrictions: including commercial applications, and to alter it and redistribute it Permission is granted to anyone to use this software for any purpose, arising from the use of this software. In no event will the authors be held liable for any damages This software is provided 'as-is', without any express or implied Copyright (c) 2002-2006 Marcus Geelnard ![]() glfw/glfw/blob/master/src/x11_window.c //= The source for X11 cursor handling is in: If you build from source and then put a breakpoint at the callback you should be able to trace what’s going on. Xinput -set-prop 12 "Coordinate Transformation Matrix" 0.6 0 0 0 0.6 0 0 0 2Ĭan I have a direction in GLFW sources so I can understand why is this causing trouble ? it's a simple scale matrix without any negative sign in it This line seems to be causing the issue, but I don't understand why since Xinput -set-prop 12 "libinput Accel Speed" -0.25 Actually, when the os start, I run the following script to reduce the mouse sensivity: So something is my configuration is fucked up xD. and it's working properly as well, like what the hell. TEST3: Plugged back the mouse on the desktop. TEST2: I plugged the mouse on the laptop. TEST1: I just tested on my laptop, running the same Ubuntu version, but using the trackpad and everything is working properly. Am I doing something wrong or is this a bug ? I'm using XUbuntu 17.04 and my mouse is "ROCCAT ROCCAT Kone XTD" as shown with xinput command line. Using glfwSetInputMode(window, GLFW_CURSOR, GLFW_CURSOR_NORMAL) is however working properly. the value is always getting lower and lower and lower :smile: moving mouse up/down/left/right/kicking_it_on_the_table GlfwSetCursorPosCallback(window, mouse_pos_callback) ![]() GlfwSetInputMode(window, GLFW_CURSOR, GLFW_CURSOR_DISABLED) Window = glfwCreateWindow(640, 480, "Simple example", NULL, NULL) Static void mouse_pos_callback(GLFWwindow *window, double x, double y) Test code static void error_callback(int error, const char *description)įprintf(stderr, "Error: %s\n", description) However, whatever the direction I’m moving the mouse, the position recieved in the callback glfwSetCursorPosCallback(window, mouse_pos_callback) is always decreasing. I’m trying to implement FPS camera using glfwSetInputMode(window, GLFW_CURSOR, GLFW_CURSOR_DISABLED) feature of GLFW. GLFW Version: 3.2.1 X11 GLX EGL clock_gettime /dev/js Xf86vm shared ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |