CodeScript Moderator Team
Joined: 08 Jun 2003 Posts: 1060 Location: India
|
Posted: Sat Sep 06, 2003 9:25 am Post subject: Swap mouse buttons |
|
|
This is a simple API code to swap your mouse buttons.
Don't use STOP or RESET SCRIPT in IDE else swapped buttons remain. If so restart the script and hit reset.
Code: | #DEFINE COMMAND,SWAPMouse
DIALOG CREATE,SwapMouseButtons By CodeScript,-1,0,323,199,ONTOP,CLICK
DIALOG ADD,BUTTON,Swap,18,86,162,52,Swap Mouse Buttons
DIALOG ADD,BUTTON,Restore,74,84,162,52,Restore
DIALOG ADD,TEXT,TEXT1,170,38,,,Right and Left mouse buttons will be restored on Exit
DIALOG ADD,TEXT,TEXT2,140,77,,,Right-Left Click on the Dialog to Test
DIALOG ADD,TEXT,TEXT3,154,70,,,Don't leave the dialog and get confused!
DIALOG SHOW
:EVLOOP
WAIT EVENT
GOTO @EVENT()
:SwapBUTTON
SWAPMouse SWAP
GOTO EVLOOP
:RestoreMenu
:RestoreBUTTON
SWAPMouse Restore
GOTO EVLOOP
:CLICK
%C = @CLICK(B)
IF @EQUAL(%C,RIGHT)
DIALOG POPUP,Restore
END
GOTO EVLOOP
:CLOSE
SWAPMouse Restore
EXIT
REM *******************************************************
REM You can Include the code below in a seperate include file
REM or a DSU.
REM ********************************************************
:SWAPMouse
IF @EQUAL(%1,SWAP)
%1 = 1
ELSE
%1 =0
END
LOADLIB USER32
%A = @LIB(USER32,SwapMouseButton,INT:,%1)
FREELIB USER32
EXIT |
_________________ Regards
- CodeScript
Give your application a professional look with the VDSGUI Extension |
|