PDA

View Full Version : Hooking Keyboard and mouse



moya
3rd August 2009, 15:22
hi everyone.
i'm a newbie in linux and qt . i have a project that i must impelement an user interface for linux operating system , thin interface should does task like this : for ex i wanna log inot a file or database every user intercation with diffrent software , whenever a user click mouse on a software for opening it , when ever the user press the keyboard in kde enviroment ,whenever a user minimize or maximaze window i wanted to know which windows became minimized or max by the user . at first i must be able to hook the mouse and keyboard with my QT application , as i told you , i should hook them because i wanna my program has the ability to process keys and mous click even if my program in working in background . i would be very thanksfull in advance of everyon that try to help me . thanks alot moya .

aamer4yu
3rd August 2009, 15:32
If you want to track events of other application than yours, it might not be possible since its an OS level operation.
If you want to track events in your application, you might consider using event filters.
QObject::installEventFilter

wagmare
3rd August 2009, 15:34
as a newbie learn events in Qt ..
http://doc.trolltech.com/4.5/qevent.html
this will be useful