Mouse problems in Allegro (Linux)
I wasn't exactly sure if I should post here or the Linux forum, but I felt that this was more an Allegro problem. I just attempted porting two projects of mine from Windows to Linux. Everything else seems to work fine but the mouse. At first the mouse sits at the center of the screen, as it should, but once I touch it, it goes straight to the upper edge of the screen. I can make it jerk to the left and right, but it won't leave the upper edge at all. Also it acts as if I was holding down the left mouse button. Obviously somethings wrong, but I have no idea what, as my mouse works fine on Linux otherwise. [eidt]Oh and I'm not doing anything fancy with the mouse functions, just install_timmer()+install_mouse() and I use the mouse_x and mouse_y variables for when I need them.[/edit] Mandrake 9.2 Logitech USB mouse (with a wheel, if it's relevant. Uses /dev/usbmouse afaik) Allegro 4.1.17 Hope that's enough info.
-Aryoc
I don't really do anything with it but use the mouse_x and mouse_y variables for when I draw the cursor, I use draw_sprite() for that (I know I could let Allegro do the drawing by itself...). Besides that I simply check the mouse_x/y vars everyone now and then in simple if (mouse_x > something && mouse_x < somethingelse) statements.
-Aryoc
What does mouse_needs_poll() return?
I really doubt that'll be the problem, but I'm not a Linux user and have no idea what's causing this, so I'm just guessing. :)
I really doubt that'll be the problem, but I'm not a Linux user and have no idea what's causing this, so I'm just guessing. :)
Jesus saves ... the rest of you take 2d4 fire damage.
mouse_needs_poll() returns false. I think I'll look into what get_mouse_mickeys() gives me and see if I can get somewhere from there.
-Aryoc
In some situations, you may need to install the mouse after the setting the graphics mode, or so I've heard. If you are unable to solve the problem, you should probably compile your source on different hardware to try to figure out where the problem lies.
It doesn't seem to make a difference if I do install_mouse() before or after setting the graphics mode. But I did notice that the mouse works fine if I run the program from X, instead of just the command-line. Which is good, because now it works. I'll just have to remember to run it from X.
-Aryoc
You are obviously using an Allegro driver which reads the mouse directly, rather than using X.
It's using the wrong protocol to talk to the mouse, which is why it misinterprets everything.
I suggest using X - the only drawback being that the default X driver is rather non-performant - it can be improved by using DGA2, but that's only available if everything is right (and run as root).
In any case, the direct-hardware drivers for Allegro are a hangover from DOS. They should not really be relied on. This includes all console-mode drivers for Linux except for Framebuffer.
You can probably fix it by selecting the right mouse type in the Allegro config. But using X is typically a good idea.
Mark
It's using the wrong protocol to talk to the mouse, which is why it misinterprets everything.
I suggest using X - the only drawback being that the default X driver is rather non-performant - it can be improved by using DGA2, but that's only available if everything is right (and run as root).
In any case, the direct-hardware drivers for Allegro are a hangover from DOS. They should not really be relied on. This includes all console-mode drivers for Linux except for Framebuffer.
You can probably fix it by selecting the right mouse type in the Allegro config. But using X is typically a good idea.
Mark
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement