Counting mouse clicks/movement and keyboard presses?
I am working on a Tcl UNIX client for SigX called TclSigX at the moment.
Basiclly what the client does is retrieve user and system stats from the computer it is installed in, format it so it looks neat and readable and send it to the SigX server, every couple of minutes. SigX then generates and updates an image with these statistics writen onto it, and you can use that image on a forum or email signature. Anyway, I wanted to impliment a feature similar to one that the Windows clients have, which is to count the number of times the mouse has been clicked, scrolled and how far it has been moved, and how many times keys on the keyboard has been pressed. As there are no (or at least stable) APIs to X for Tcl, the only solutions I can see to this problem is figuring this stuff out via some command, or making up a [C] helper program to come with TclSigX. I'd like to avoid making up a helper. So, would anyone be able to help me out a bit here? |
Hey I `ve seen one such utility
Its a command by name xev And it does the job pretty well.It gives me the statistics of mouse click , release Keyboard press,etc But I am not sure whether its there in Tcl Unix or not. Cheers Z |
Quote:
thanks |
Running just xev on the command prompt will create a window
If u click on the window the X,Y coordinates and the type of click will be displayed. You can also use xev to get mouse related info from an existing window. Ex: You have a Xterm and you want to get mouse related info from that window Go to the xterm Type xwininfo THis will give you the windows id. Then use xev -id <windows_id> to track the evens from window with window id <windowid> |
Also there is another command line tool call xmacro.
Its used for recording keyboard and mouse events and replay them. I guess it should be useful for your query Install xmacro [its a very small utility] Run xmacrorec2 Click the mouse anywhere and see the Button Number and coordinated getting logged. |
Quote:
You can write an interrupt handler for keyboard strokes: http://www.linuxquestions.org/questi...2/#post3771000 This one runs from the user space, but it has termios struct, see for yourself if that works in your case. http://www.linuxquestions.org/questi...1/#post3956458 and look at this too: http://www.win.tue.nl/~aeb/linux/kbd/scancodes.html |
:doh::doh: Now I realize the thread is from 2005!
|
Quote:
this part of the errors: Code:
xmacroplay.cpp: In function ‘void eventLoop(Display*, int)’: |
Quote:
|
Quote:
|
Quote:
---------- Post added Jan 24th, 2011 at 07:02 ---------- Quote:
|
All times are GMT -5. The time now is 08:26 AM. |