Hi All,
I just subscribed so please forgive if I ask a question that was
answered here recently. This mailing list doesn’t have a search function
and the complete archive is too big to download (50 MB) so I thought I
would simply ask you directly:
I have been using libsdl for about six months already. The application
we develop runs under X11 (window/fullscreen) and also on console
(fbcon/svgalib). Under X11 there’s no problem. But on the console we are
having problems with mouse. The mouse movements are not detected
properly - the mouse cursor usually does not move at all or the movement
is often incorrectly detected as mouse button clicks.
I remember that the mouse used to work fine on fbcon in April this year
(libsdl probably version 1.2.0, or pre1.2.0). It never worked on
svgalib, though. Currently I have libsdl 1.2.1 (Debian) and tried 1.2.2
(rpm) and neither fbcon nor svgalib mouse works.
My question is whether there were any changes in 1.2.x regarding reading
mouse on console (particularly fbcon). I didn’t change my code nor my
system environment (IIRC). We also observed this problem on several
machines with different Linux distributions (Debian Sid, Redhat 7.x).
The code for reading mouse movements is rather simple and looks like
this (simplified):
init:
SDL_WM_GrabInput(SDL_GRAB_ON);
SDL_ShowCursor(SDL_DISABLE);
once in a while (each 20 milliseconds):
while (SDL_PollEvent(&event)) {
int type = event.type;
if (type == SDL_MOUSEMOTION) {
SDL_MouseMotionEvent eve = event.motion;
int xrel = eve.xrel;
int yrel = eve.yrel;
// follows code that works with xrel and yrel and
// draws the mouse cursor
}
}
I don’t claim this code is perfect - I followed the documentation on
libsdl.org and also the trial-error path. It works perfectly in X11 and
used to work well on fbcon. But now it doesn’t work.
Thanks for any hints.
Petr
P.S. I heard I could try to run gpm in repeater mode. I tried it but it
didn’t help.