One owned text-input session at a time. While a session exists, xScal consumes keyboard key, character and raw-input messages before Fallout 76 gets them; mouse raw input still reaches the game. The native buffer holds at most 512 UTF-16 code units. A key still held when the session ends stays consumed until its key-up message.
var begin:Object = JSON.parse(__SFCodeObj.call("Input.BeginInput"));
if (begin.success) {
var sessionId:uint = uint(begin.sessionId);
// From a timer or frame callback:var current:Object = JSON.parse(
__SFCodeObj.call("Input.PollInput", sessionId));
if (current.state == "submitted") {
sendMessage(String(current.text));
__SFCodeObj.call("Input.EndInput", sessionId);
} elseif (current.state == "cancelled") {
__SFCodeObj.call("Input.EndInput", sessionId);
}
}
Increments on text changes, cursor moves, Enter and Escape.
text
String
Current text, UTF-8.
caretIndex
int
Cursor position in UTF-16 code units, the same unit as AS3 String
indexes. A surrogate pair counts as two. Read-only; Left, Right,
Home and End move it.
Increments on text changes, cursor moves, Enter and Escape.
text
String
Current text, UTF-8.
caretIndex
int
Cursor position in UTF-16 code units, the same unit as AS3 String
indexes. A surrogate pair counts as two. Read-only; Left, Right,
Home and End move it.
The session stays allocated after Enter or Escape until this call succeeds. Invalid or stale session IDs return {"success":false,"error":"invalid_session"}.