LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Embedded & Single-board computer (https://www.linuxquestions.org/questions/linux-embedded-and-single-board-computer-78/)
-   -   In console program,how to receive mouse event from driver (https://www.linuxquestions.org/questions/linux-embedded-and-single-board-computer-78/in-console-program-how-to-receive-mouse-event-from-driver-654204/)

wangchaoye 07-07-2008 08:26 PM

In console program,how to receive mouse event from driver
 
Hello all,
I'm doing a project in linux use mips arch,so all the programs is console program.Without xwindow and other third-party gui lib,how can I use mouse,that is,how can I receive mouse event from the mouse driver and send it to the upper program.
I need a clue or example on the question, any help would be appreciated!!


Best regards,
Wang Chaoye

Mega Man X 07-08-2008 01:57 PM

Quote:

Originally Posted by wangchaoye (Post 3207193)
Hello all,
I'm doing a project in linux use mips arch,so all the programs is console program.Without xwindow and other third-party gui lib,how can I use mouse,that is,how can I receive mouse event from the mouse driver and send it to the upper program.
I need a clue or example on the question, any help would be appreciated!!


Best regards,
Wang Chaoye

Not sure if this will help, but Linux uses a daemon to allow you copy and paste from/to the command line, called "gpm". You may want to check that utility and see if that is any good start for you?

http://linux.about.com/library/cmd/blcmdl8_gpm.htm

Regards!

resetreset 07-15-2008 05:00 AM

i dont know anything about MIPS, but i think what you said means you can try reading the mouse device file. it used to be /dev/mouse a long time ago, i dont know what it is nowadays, because they've changed things a lot, eg. if you have a USB mouse you may have to read the USB port's device file or something, your distro may not be polite enough to make a "/dev/mouse" link to the USB device file when you plug in the mouse. theres something called HID compliance or whatever as well i think.


All times are GMT -5. The time now is 10:23 PM.