Mouse pointer problem
Hi,
In one of my programs I want a DropList to appear during a run and choose an item and then hide the list and the mouse pointer again. It all works fine except that the mouse will not go away until I move it after I disabled it. I tried viz.sendEvent(viz.MOUSE_MOVE_EVENT) to simulate a mouse movement but the pointer only disappears after a real mouse movement. Is it possible to hide the mouse without physically moving it? Thanks in advance, Albert Code:
import viz |
I ran into a similar issue a few years ago. What I came up with is show below. I found this function that acts as if the mouse has been moved and the left button clicked.
Code:
from ctypes import * click(1,1) and it's like you clicked it at the location x=1,y=1. For me, the mouse click was actually more important than moving the mouse, so I ended up modifying the the code so that instead of moving the mouse to the passed x and y, I just kept it at the same point and performed the mouse click. Aaron |
Thanks Aaron, windll.user32.SetCursorPos(x,y) solved my problem.
|
All times are GMT -7. The time now is 11:02 PM. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC