0

i want to develop a simple application without a GUI in c++ which detects mouse up and mouse down events in linux .I have no idea about how to read input events directly from /dev/input/* in linux , any pointers on how to proceed will be great .


Also, Links to any tutorials/articles will be greatly appreciated .

rajat
  • 3,415
  • 15
  • 56
  • 90
  • Wouldn't it be easier to use [gpm](http://www.nico.schottelius.org/software/gpm/)? – fvu Jul 15 '12 at 11:24
  • I never heard of it , it looks interesting . Can you describe with an example or something about how to use gpm . I am completely new with linux . – rajat Jul 15 '12 at 11:36
  • many (most?) Linux distros come with gpm, so it should just be a matter of enabling it. [This tutorial](http://www.gentoo.org/doc/en/gpm.xml) shows the steps needed. Many console mode programs will be based on [ncurses](http://www.gnu.org/software/ncurses/) - also standard on I think every distro - so reacting to mouse events will at the low level be handled by curses. – fvu Jul 15 '12 at 11:41
  • Please see http://stackoverflow.com/questions/5060710/format-of-dev-input-event – fons May 30 '14 at 18:42
  • Possible duplicate of [How do you read the mouse button state from /dev/input/mice?](https://stackoverflow.com/questions/11451618/how-do-you-read-the-mouse-button-state-from-dev-input-mice) – scohe001 May 28 '19 at 15:28

0 Answers0