Page tree
Skip to end of metadata
Go to start of metadata

Introduced in

Version:2.08

Description

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: [] call fn_vbs_showMouseCursor

Syntax

Syntax:[[eventN,codeN,...], [key, toggle], cursor] call fn_vbs_showMouseCursor
Parameters:
  • eventN: String - One or more Reference List, each followed by the associated code.
  • codeN: String - Code that should be executed for this event.
  • key: Number - DIK code of key that activates the cursor.
  • toggle: Boolean - If true, the cursor is shown until key is pressed again. If false, then the cursor is only shown while key is held.
  • cursor: String - Type of cursor to show while active (see setCursorType for possible types) (optional, default: Arrow).
Return Value:Nothing

Warning

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

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

Additional Information

See also: 
Multiplayer: 
Problems: 

Notes