Our machine runs a modified RedHat 9 (Kernel Linux 2.6.20-1.21, GNOME 2.10.0). When USB mouse is plugged in, the X Window will always switch out, we have to switch back by Alt + F7. There is no such problem with PS2 mouse.
So, one line was added into /etc/udev/rules.d/15-mouse.rules:
KERNEL=="mouse", BUS=="usb", SYSFS{product}=="Mouse", MODE="0660", NAME="input/mouse0", PROGRAM="/bin/sh -c 'chvt 8; chvt 7'"
But these days, we found this doesn't work for 2 machines. I have to use Alt + F9 to switch back to X Window.
I am new to this, can anybody help me to understand:
Why virtual terminals are switched when USB mouse is plugged in?
I thought #7 virtual terminal is used for X window, why it is changed to #9?
Thank you.