Utilities.Client
Features from ISteamUtil with a few extras from Heathen!

Like what your seeing?

Consider supporting us as a GitHub Sponsor and get instant access to all our Unity assets, exclusive tools and assets, escalated support and issue tracking and our gratitude. These articles are made possible by our GitHub Sponsors ... become a sponsor today!

Introduction

using SteamUtils = HeathenEngineering.SteamworksIntegration.API.Utilities.Client;
public static class Utilities.Client
This leverages features of ISteamUtil to simplify working for Steam's Virtual Keyboard and launcher features..

Events

EventAppResumFromSuspend

Invoked when the app regains focus from suspend as seen by Steam Client.
public static UnityEvent EventAppResumFromSuspend => get;
This event has no arguments so its handler will take the form of
void HandleAppResumFromSuspendEvent()
{
// The app has just resumed
}

EventKeyboardShown

Invoked when the Steam virtual keyboard is shown to the user. This virtual keyboard sends OS Key events so should trigger Unity's input systems normally. It is only shown to the user when you request it via the ShowVirtualKeyboard method.
public static UnityEvent EventKeyboardShown => get;
This event has no arguments
But how do I get the text?
It is a true virtual keyboard, so Unity's Input system should be triggered by the key strokes as if it was a real keyboard.
void HandleKeyboardShownEvent()
{
// The virtual keyboard has been shown
}

EventKeyboardClosed

Invoked when the Steam virtual keyboard is closed.
public static UnityEvent EventKeyboardClosed => get;
This event has no arguments
But how do I get the text?
It is a true virtual keyboard, so Unity's Input system should be triggered by the key strokes as if it was a real keyboard.
void HandleKeyboardClosedEvent()
{
// The virtual keyboard has been closed
}

Fields and Attributes

IP Country

public static string IpCountry => get;

Seconds Since App Active

public static uint SecondsSinceAppActive => get;

Server Real Time

public static DateTime ServerRealTime => get;

Steam UI Language

public static string SteamUILanguage => get;

Big Picture Mode

public static bool IsSteamInBigPictureMode => get;

In VR Mode

public static bool IsSteamRunningInVR => get;

In Steam Deck

public static bool IsSteamRunningONSteamDeck => get;

VR Streaming Enabled

public static bool IsVRHeadsetStreamingenabled => get;

Methods

SetGameLauncherMode

In game launchers that don't have controller support you can call this to have Steam Input translate the controller input into mouse/kb to navigate the launcher
public static void SetGameLauncherMode(bool mode);

mode

Whether a launcher is active or not

StartVRDashboard

Asks Steam to create and render the OpenVR dashboard.
public static void StartVRDashboard();

ShowVirtualKeyboard

Opens a floating keyboard over the game content and sends OS keyboard keys directly to the game. The text field position is specified in pixels relative the origin of the game window and is used to position the floating keyboard in a way that doesn't cover the text field.
But how do I get the text?
It is a true virtual keyboard, so Unity's Input system should be triggered by the key strokes as if it was a real keyboard.
public static bool ShowVirtualKeyboard(
EFloatingGamepadTextInputMode mode,
int2 fieldPosition,
int2 fieldSize)
returns true if the floating keyboard was shown, otherwise, false.

mode

Selects the keyboard type to use

fieldPosition

Coordinate of where to position the floating keyboard

fieldSize

Desired size of the floating keyboard