[Interest] [QtGui] Clip cursor position

Nye kshegunov at gmail.com
Tue Dec 22 10:44:04 CET 2015


Hello,
Is it possible to clip the mouse cursor to a specific area of the screen?
I've tried to limit the cursor movement by installing an event filter on
the application object and moving it back when its position got outside of
my target rectangle, but the results proved to be unsatisfactory, as there
is considerable "flicker". I then dig deeper and tried installing a window
system event handler on QWindowSystemInterfacePrivate by subclassing the
QWindowSystemEventHandler class available, reimplementing the sendEvent()
function, and plugging that in the appropriate place, but (as expected) the
behavior was only marginally better. I'm considering changing the
QPlatformWindow and trying to do it directly from there (actually from
QXcbWindow) but decided to ask first if there is actually a better way. Any
input is highly appreciated.

Kind regards.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20151222/7299b128/attachment.html>


More information about the Interest mailing list