开发者

Programatically fire a QMouseEvent and Keyboard Event given only global x,y coordinate

on MachineA the MouseMove events are trapped from screen to M开发者_开发问答achine B's viewerWidget. and MouseClick Events from MachineB's widget are carried to MachineA's Screen. KeyboardEvent of MachineB are carried to MachineA. I dont know on what widget this events triggered. What I know is the global x, y coordinates. even for KeyboardEvents.

My Questions are:

  1. How to trap/fire the MouseMove or MouseClick Events from/to desktopWidget ?
  2. how to trap/fire the Keyboard Events from/to desktopWidget ?


Something similar to this should do the trick.

QMouseEvent* event = new QMouseEvent( QEvent::MouseButtonPress, QPoint( x, y ), button, modifiers);
QApplication::postEvent( widget, event );
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜