Hi,
How can I lock the mouse ?
// \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 / END
system("xinput disable ID mouse")
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 44 guests