向系统发送键盘事件:
void QWSServer::sendKeyEvent ( int unicode, int keycode, Qt::KeyboardModifiers modifiers, bool isPress, bool autoRepeat ) [static]
向系统发送鼠标事件:
QMouseEvent *mEvnPress;
QMouseEvent *mEvnRelease;
mEvnPress = new QMouseEvent(QEvent::MouseButtonPress, pos, Qt::LeftButton, Qt::LeftButton, Qt::NoModifier);
QApplication::sendEvent(QWidget::focusWidget(),mEvnPress);
mEvnRelease = new QMouseEvent(QEvent::MouseButtonRelease, pos, Qt::LeftButton, Qt::LeftButton, Qt::NoModifier);
QApplication::sendEvent(QWidget::focusWidget(),mEvnRelease);
http://topic.csdn.net/u/20110225/01/c1e12154-449e-4ca5-996f-50b5e13ba11a.html