Click to See Complete Forum and Search --> : won't startup w/o mouse
phatbeatsboy
06-09-2004, 03:15 PM
for this little projects i'm working on, i basically have a little program that runs on red hat 9 and it involves a little touch screen with a gui. it works fine and dandy when i start up the box with a mouse plugged in. however, with no mouse, red hat goes through its startup, but my program doesn't start up.
any ideas, that might have something to do with a red hat settting or something to that effect? like can i trick it into thinking there is a mouse present?
hard candy
06-09-2004, 04:05 PM
Look into disabling "gpm" -gpm means general purpose mouse and is the mouse support for linux in the console. And maybe commenting out the mouse section in XF86Config-4. I think these are what is keeping the boot-up into the GUI from happening. Gpm docs should be in /usr/share/docs.
phatbeatsboy
06-09-2004, 04:26 PM
why doesn't my keyboard work if i start my computer without a mouse plugged into it
i'm running red hat 9.0
Dark Ninja
06-09-2004, 04:33 PM
What computer are you running. Please provide us specs/more info. What kind of keyboard. What kind of mouse. Are they USB, PS/2?
The more information we have, the better we can help.
tecknophreak
06-10-2004, 01:52 PM
When you say that you're keyboard doesn't work when the mouse is not plugged in, is that with X only or if you use a text login too?
tecknophreak
06-14-2004, 09:09 AM
Originally posted by hard candy
Look into disabling "gpm" -gpm means general purpose mouse and is the mouse support for linux in the console. And maybe commenting out the mouse section in XF86Config-4. I think these are what is keeping the boot-up into the GUI from happening. Gpm docs should be in /usr/share/docs.
Commenting out the mouse section in the XF86Config causes a startup error, no core pointer error, so that won't work. mayhap a google search will help?
mdwatts
06-14-2004, 10:34 AM
Originally posted by tecknophreak
Commenting out the mouse section in the XF86Config causes a startup error, no core pointer error, so that won't work. mayhap a google search will help?
Do you have
Option "AllowMouseOpenFail" "true"
in the ServerFlags section of your X config?
tecknophreak
06-14-2004, 10:59 AM
I actually just found that and it doesn't seem to work. :(
Is there a way to poll to see if there is a mouse attached? yeah, but anyone know where the code/script is? I'm checking a few different files/man pages, which aren't helping too much yet.
tecknophreak
06-14-2004, 11:25 AM
Well, it turns out that it takes patience to run without the mouse and the AllowMouseOpenFail option. It took about 30 seconds to actually startx.
In the meantime, I wrote a little program to check the mouse, based on the mouse man page.
#include <iostream>
#include <unistd.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <fcntl.h>
using namespace std;
int main() {
int fd, res(-1);
char ch;
bool done(false);
fd = open("/dev/psmouse", O_RDWR | O_NONBLOCK);
if (fd < 0) {
cerr << "Could not open " << strerror(errno) << endl;
return -1;
}
ch = 0; // the man page says to drop the line and bring it back to get info from the mouse
write(fd, &ch, 1);
ch = 1;
write(fd, &ch, 1);
for (int i = 0; i < 10 && res < 0; ++i) {
res = read(fd, &ch, 1);
}
close(fd);
if (res < 0) {
cout << "Mouse is not connected" << endl;
return -1;
}
cout << "Mouse is connected" << endl;
return 0;
}
wrote in C++ only because I like cout better than printf.
right, this only works without X or GPM running
phatbeatsboy
06-16-2004, 03:19 PM
still dealing with this problem.......
it turns out that if I start up the computer with the mouse connected, I can start X whenever i want as long as i know whether the mouse is connected or not. ( via that little program from tecknophreak)
however, if I start the computer up without the mouse attached, then check the config file just to make sure, and try to startx i get nothing, even though i use the same config file as when i start the computer with the mouse pluged in.
my brain is fried, so sorry if that was hard to follow