|Description:||Brings up a cursor that can be moved around the screen, and which can have user-defined actions assigned to it. |
To turn off any previously defined cursor actions, call the function without any arguments:
|Syntax:||[[eventN,codeN,...], [key, toggle], cursor] call fn_vbs_showMouseCursor|
When using functions in VBS versions older than 3.4, certain limitations and requirements should be kept in mind - the main ones being that capitalization of the function name is crucial, and that #include "\vbs2\headers\function_library.hpp" has to be included in every script that utilizes it. More Category VBS Scripting Functions.
|Examples:||When "A" (DIK #30) is pressed, the cursor mode is toggled on and off, and any mouse click while it is active will result in a hint message:|
[["onMouseButtonDown","hint 'mouse clicked'"],[30,true],"Move"] call fn_vbs_showMouseCursor;Same action as above, plus when the mouse is double-clicked a chat message is displayed:
[ ["onMouseButtonDown","hint 'clicked'","onMouseButtonDblClick","player sidechat 'double-clicked'], [30,true], "Move" ] call fn_vbs_showMouseCursor;Demo mission: showMouseCursor.zip