[Qt-interest] System-wide key listenning - keylogger
Gabriele Kahlout
gabriele at mysimpatico.com
Sat May 8 10:13:19 CEST 2010
Could someone provide a SSCCE of code that uses a QxtGlobalShortcut.
2010/5/2 Gabriele Kahlout <gabriele at mysimpatico.com>
>
> I almost managed to use it, but my slot doesn't get called. Yet the
>>> intercepted key, doesn't type when I attempt.
>>> When I run the application I get printed:
>>>
>>> 0x1223a40
>>>
>>> Unfortunately couldn't find any SSCCE. Your help is appreciated.
>>>
>>> My code:
>>>
>>> #include <QApplication>
>>> #include <QxtGui>
>>> #include "window.h"
>>>
>>> int main(int argc, char *argv[]){
>>>
>>> QApplication app(argc, argv);
>>> Window window;
>>> QxtGlobalShortcut* shortcut = new
>>> QxtGlobalShortcut(QKeySequence(Qt::Key_A), &window);
>>> window.connect(shortcut, SIGNAL(activated()), SLOT(save()));
>>>
>> //plcing it in the constructor for window doesn't solve.
>
>>
>>> return app.exec();
>>> }
>>>
>>>
>>> #ifndef WINDOW_H
>>> #define WINDOW_H
>>>
>>> #include <QDialog>
>>> #include <QDir>
>>>
>>> QT_BEGIN_NAMESPACE
>>> class QComboBox;
>>> class QLabel;
>>> class QPushButton;
>>> class QTableWidgetItem;
>>> QT_END_NAMESPACE
>>>
>>> class Window : public QDialog{
>>> Q_OBJECT
>>>
>>> public:
>>> Window(QWidget *parent = 0);
>>>
>>> private slots:
>>> void save();
>>> void send();
>>> void fd();
>>>
>>>
>>> void Window::fd(){
>>> this->show();
>>> }
>>>
>>>
>>>
>>>
>>>> --
>>>>
>>>> Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
>>>> Senior Product Manager - Nokia, Qt Development Frameworks
>>>> PGP/GPG: 0x6EF45358; fingerprint:
>>>> E067 918B B660 DBD1 105C 966C 33F5 F005 6EF4 5358
>>>>
>>>> _______________________________________________
>>>> Qt-interest mailing list
>>>> Qt-interest at trolltech.com
>>>> http://lists.trolltech.com/mailman/listinfo/qt-interest
>>>>
>>>>
>>>
>>>
>>> --
>>> Regards,
>>> K. Gabriele
>>>
>>> --- unchanged since 25/1/10 ---
>>> P.S. Unless a notification (LON), please reply either with an answer OR
>>> with " ACK" appended to this subject within 48 hours. Otherwise, I might
>>> resend.
>>> In(LON, this) ∨ In(48h, TimeNow) ∨ ∃x. In(x, MyInbox) ∧ IsAnswerTo(x,
>>> this) ∨ (In(subject(this), subject(x)) ∧ In(ACK, subject(x)) ∧
>>> ¬IsAnswerTo(x,this)) ⇒ ¬IResend(this).
>>>
>>> Also note that correspondence may be received only from specified a
>>> priori senders, or if the subject of this email ends with a code, eg.
>>> -LICHT01X, then also from senders whose reply contains it.
>>> ∀x. In(x, MyInbox) ⇒ In(senderAddress(x), MySafeSenderList) ∨ (∃y. In(y,
>>> subject(this) ) ∧ In(y,x) ∧ isCodeLike(y, -LICHT01X) ).
>>>
>>>
>>
>>
>> --
>> Regards,
>> K. Gabriele
>>
>> --- unchanged since 25/1/10 ---
>> P.S. Unless a notification (LON), please reply either with an answer OR
>> with " ACK" appended to this subject within 48 hours. Otherwise, I might
>> resend.
>> In(LON, this) ∨ In(48h, TimeNow) ∨ ∃x. In(x, MyInbox) ∧ IsAnswerTo(x,
>> this) ∨ (In(subject(this), subject(x)) ∧ In(ACK, subject(x)) ∧
>> ¬IsAnswerTo(x,this)) ⇒ ¬IResend(this).
>>
>> Also note that correspondence may be received only from specified a priori
>> senders, or if the subject of this email ends with a code, eg. -LICHT01X,
>> then also from senders whose reply contains it.
>> ∀x. In(x, MyInbox) ⇒ In(senderAddress(x), MySafeSenderList) ∨ (∃y. In(y,
>> subject(this) ) ∧ In(y,x) ∧ isCodeLike(y, -LICHT01X) ).
>>
>>
>
>
> --
> Regards,
> K. Gabriele
>
> --- unchanged since 25/1/10 ---
> P.S. Unless a notification (LON), please reply either with an answer OR
> with " ACK" appended to this subject within 48 hours. Otherwise, I might
> resend.
> In(LON, this) ∨ In(48h, TimeNow) ∨ ∃x. In(x, MyInbox) ∧ IsAnswerTo(x, this)
> ∨ (In(subject(this), subject(x)) ∧ In(ACK, subject(x)) ∧
> ¬IsAnswerTo(x,this)) ⇒ ¬IResend(this).
>
> Also note that correspondence may be received only from specified a priori
> senders, or if the subject of this email ends with a code, eg. -LICHT01X,
> then also from senders whose reply contains it.
> ∀x. In(x, MyInbox) ⇒ In(senderAddress(x), MySafeSenderList) ∨ (∃y. In(y,
> subject(this) ) ∧ In(y,x) ∧ isCodeLike(y, -LICHT01X) ).
>
>
--
Regards,
K. Gabriele
--- unchanged since 25/1/10 ---
P.S. Unless a notification (LON), please reply either with an answer OR with
" ACK" appended to this subject within 48 hours. Otherwise, I might resend.
In(LON, this) ∨ In(48h, TimeNow) ∨ ∃x. In(x, MyInbox) ∧ IsAnswerTo(x, this)
∨ (In(subject(this), subject(x)) ∧ In(ACK, subject(x)) ∧
¬IsAnswerTo(x,this)) ⇒ ¬IResend(this).
Also note that correspondence may be received only from specified a priori
senders, or if the subject of this email ends with a code, eg. -LICHT01X,
then also from senders whose reply contains it.
∀x. In(x, MyInbox) ⇒ In(senderAddress(x), MySafeSenderList) ∨ (∃y. In(y,
subject(this) ) ∧ In(y,x) ∧ isCodeLike(y, -LICHT01X) ).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100508/0e583c3c/attachment.html
More information about the Qt-interest-old
mailing list