bindKey (VBS2)

From Bohemia Interactive Community

Jump to: navigation, search
Editors, please check Policy: Scripting Command Page Syntax.
Introduced in Virtual Battlespace 2 version 1.20

Click on the images for descriptions

Introduced in

Game:
Virtual Battlespace 2
Version:
1.20

Description

Description:
Assigns a command to an action key. A list of available actions can be found here. The command also accepts DIK codes as enumerated here.

If the command returns true, then the keystroke will be intercepted and will not be processed as a normal key stroke. For example, you could overwrite the "fire weapon" button, so pressing it no longer fires the weapon.

Syntax

Syntax:
(keystroke OR keycode) bindKey command
Parameters:
keystroke: String (see examples under Notes)
keycode: Number (see examples under Notes)
command: String (a scripting command)
Return Value:
Number - key index (to be used with unBindKey)

Examples

Example 1:
"MoveForward" bindKey "removeAllWeapons player"
will disarm player as he steps forward
Example 2:
0xC8 bindKey "removeAllWeapons player"
will disarm player as he presses the UP arrow key

Additional Information

Multiplayer:
Behaviour unknown.
See also:
actionKeysNames, unBindKey, ctrlSetEventHandler, displaySetEventHandler

Notes

Notes

+ Add Note

Only post proven facts here. Use the talk page or the forums for discussions.

Notes

The command may not work while dialogs are open. If you need to capture keystrokes while a dialog is open you should use ctrlSetEventHandler or displaySetEventHandler.

Bottom Section

Personal tools
Buy ArmA now!