mmm...I never actually thought about this...
I would suggest you look into the mouse's filedescriptor. and try to access it ex. /dev/mouse
otherwise, you can create a "pipe" from mouse filedescriptor to stdin. but as far as I know, the stdin is buffered and mouse is streaming, so you got to take that into consideration.