Hi,
How can I lock the mouse ?
Hi,
How can I lock the mouse ?
Thank you, Karinha! But that's not what I need. I don't need to hide the cursor, but to prevent it from moving around the screen
// \samples\TRAVMOUS.PRG
#Include "FiveWin.ch"
STATIC oWnd, oTimer
FUNCTION Main()
LOCAL oBar, oExit
PUBLIC oTimer
DEFINE WINDOW oWnd TITLE "Lock Mouse - Look This."
DEFINE BUTTONBAR oBar BUTTONSIZE 64, 50 _3DLOOK TOP OF oWnd 2007
DEFINE BUTTON oExit OF oBar NOBORDER GROUP PROMPT "&Exit" ;
FILENAME "..\bitmaps\16x16\Exit.bmp" ;
ACTION( oWnd:End() ) TOOLTIP "Exit this app" TOP
SET MESSAGE OF oWnd TO "Lock Mouse" NOINSET CLOCK DATE KEYBOARD
oTimer := TTimer():New( 5, {|| RRLOCK_MOUSE() }, oWnd )
oTimer:Activate()
SysRefresh()
// Right click
oWnd:bRClicked := {|| RCloseProg() }
ACTIVATE WINDOW oWnd MAXIMIZED
oTimer:End()
RETURN NIL
FUNCTION RCloseProg()
oWnd:End()
RETURN NIL
STATIC FUNCTION RRLOCK_MOUSE()
SetCursorPos( 500, 500 ) // 1000, 1000
RETURN( .T. )
// FIN / ENDThanks, I'm actually processing :MMove() on the window. Each time the cursor coordinates change, some processing takes time (and the user, at this time, moves the mouse). Thus, synchronization is disrupted. I was hoping to solve this by RUNSLL32.exe mouse, disable But under 10 it doesn't work
Example?
It's always easier to get support when you have a simple example of what you want to do and you're not getting it.
Regards, saludos.
system("xinput disable ID mouse")