xScal Scaleform API 0.4.34

Input: keyboard

Windows virtual-key codes 1 to 255. A key must be registered before Input.IsKeyPressed reports it; unregistered keys return false. Polling a few keys once per frame is cheap.

Input.RegisterKey

Register a virtual key for polling

__SFCodeObj.call("Input.RegisterKey", key:uint):Boolean

Arguments

NameTypeDescription
keyuintWindows virtual-key code, for example 75 for K. 1 to 255.

Returns Boolean

Registering a key that is already registered returns true.

Input.IsKeyPressed

Is a registered key held

__SFCodeObj.call("Input.IsKeyPressed", key:uint):Boolean

Arguments

NameTypeDescription
keyuintWindows virtual-key code, for example 75 for K. 1 to 255.

Returns Boolean

true while the registered key is held and Fallout 76 is the foreground process. Reports the held state; for one action per press, compare with the previous frame's value.

Example

var wasPressed:Boolean = false;
function onEnterFrame(event:Event):void {
    var pressed:Boolean = __SFCodeObj.call("Input.IsKeyPressed", 75);
    if (pressed && !wasPressed) {
        // K was just pressed.
    }
    wasPressed = pressed;
}

Input.UnregisterKey

Unregister one key

__SFCodeObj.call("Input.UnregisterKey", key:uint):Boolean

Arguments

NameTypeDescription
keyuintWindows virtual-key code, for example 75 for K. 1 to 255.

Returns Boolean

Returns false if the key was not registered.

Input.ClearKeys

Unregister every key

__SFCodeObj.call("Input.ClearKeys"):Boolean

No arguments.

Returns Boolean

Always true.

Input.SuppressKey

Hide a key from Fallout 76

__SFCodeObj.call("Input.SuppressKey", key:uint):Boolean

Arguments

NameTypeDescription
keyuintWindows virtual-key code, for example 75 for K. 1 to 255.

Returns Boolean

Hides the key from Fallout 76's window messages and raw keyboard input. Input.IsKeyPressed still reports it. Returns false if the game window is not available yet; the key stays recorded and the next Input.SuppressKey call retries.

Input.UnsuppressKey

Stop hiding one key

__SFCodeObj.call("Input.UnsuppressKey", key:uint):Boolean

Arguments

NameTypeDescription
keyuintWindows virtual-key code, for example 75 for K. 1 to 255.

Returns Boolean

Returns false if the key was not suppressed. If the key's press was hidden, its release is hidden too.

Input.ClearKeySuppressions

Stop hiding every key

__SFCodeObj.call("Input.ClearKeySuppressions"):Boolean

No arguments.

Returns Boolean

Always true.