how to check the status of mouse-button/ a key press in linux using C ?
Hi all,
In a C code, I need to : 1) check if a mouse button is pressed down. I need to check this status of mouse button again and again inside a loop. Depending on the status, some function will be called. OR 2) check if some key of the keyboard is pressed down. I need to check this status of 'key' again and again inside a loop. Depending on the status, some function will be called. Either of the two above will serve my purpose. I am using Ubuntu 10.10. Please help. Its urgent... |
Well this seems like the wrong section and you used a forbidden word. It maybe Urgent for you, it's really not urgent for us, however since most of the post is to the point or well formed....
I have seen several things that could point you in the right direction on <insert generic search engine here> with just entering "C library mouse". This is never something I have done with C so I couldn't give anymore advice then that myself. Overall I don't think this is going to have a simple answer as I don't think C holds a keypress status, you could do a getchar or getch but if the user is holding down multiple keys... |
Quote:
|
Quote:
|
Thank you both for the input. After a lot of googling without any real success, I adopted an alternative simpler approach to do what I wanted without scanning the input device status.... However it will be interesting if someone could find a solution to the task (in my first post above).
Pardon me if I did something wrong (this was my post on LQ)... |
All times are GMT -5. The time now is 09:25 PM. |