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
.
- How to trap/fire the MouseMove or MouseClick Events from/to desktopWidget ?
- 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 );
精彩评论