Rise
The Vieneo Province
Loading...
Searching...
No Matches
isteamremoteplay.h
Go to the documentation of this file.
1//============ Copyright (c) Valve Corporation, All rights reserved. ============
2
3#ifndef ISTEAMREMOTEPLAY_H
4#define ISTEAMREMOTEPLAY_H
5#ifdef _WIN32
6#pragma once
7#endif
8
9#include "steam_api_common.h"
10
11
12//-----------------------------------------------------------------------------
13// Purpose: The form factor of a device
14//-----------------------------------------------------------------------------
24
25
26// Steam Remote Play session ID
28
29
30// Steam Remote Play mouse cursor ID
32
33
34//-----------------------------------------------------------------------------
35// Purpose: The type of input in ERemotePlayInput_t
36//-----------------------------------------------------------------------------
47
48
49//-----------------------------------------------------------------------------
50// Purpose: Mouse buttons in ERemotePlayInput_t
51//-----------------------------------------------------------------------------
60
61
62//-----------------------------------------------------------------------------
63// Purpose: Mouse wheel direction in ERemotePlayInput_t
64//-----------------------------------------------------------------------------
72
73
74//-----------------------------------------------------------------------------
75// Purpose: Key scancode in ERemotePlayInput_t
76//
77// This is a USB scancode value as defined for the Keyboard/Keypad Page (0x07)
78// This enumeration isn't a complete list, just the most commonly used keys.
79//-----------------------------------------------------------------------------
81{
83
110
121
139
152
163
180
184 k_ERemotePlayScancodeLeftGUI = 227, // windows, command (apple), meta
188 k_ERemotePlayScancodeRightGUI = 231, // windows, command (apple), meta
189};
190
191
192//-----------------------------------------------------------------------------
193// Purpose: Key modifier in ERemotePlayInput_t
194//-----------------------------------------------------------------------------
210
211
212#if defined( VALVE_CALLBACK_PACK_SMALL )
213#pragma pack( push, 4 )
214#elif defined( VALVE_CALLBACK_PACK_LARGE )
215#pragma pack( push, 8 )
216#else
217#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx
218#endif
219
220// Mouse motion event data, valid when m_eType is k_ERemotePlayInputMouseMotion
222{
223 bool m_bAbsolute; // True if this is absolute mouse motion and m_flNormalizedX and m_flNormalizedY are valid
224 float m_flNormalizedX; // The absolute X position of the mouse, normalized to the display, if m_bAbsolute is true
225 float m_flNormalizedY; // The absolute Y position of the mouse, normalized to the display, if m_bAbsolute is true
226 int m_nDeltaX; // Relative mouse motion in the X direction
227 int m_nDeltaY; // Relative mouse motion in the Y direction
228};
229
230// Mouse wheel event data, valid when m_eType is k_ERemotePlayInputMouseWheel
232{
234 float m_flAmount; // 1.0f is a single click of the wheel, 120 units on Windows
235};
236
237// Key event data, valid when m_eType is k_ERemotePlayInputKeyDown or k_ERemotePlayInputKeyUp
239{
240 int m_eScancode; // Keyboard scancode, common values are defined in ERemotePlayScancode
241 uint32 m_unModifiers; // Mask of ERemotePlayKeyModifier active for this key event
242 uint32 m_unKeycode; // UCS-4 character generated by the keypress, or 0 if it wasn't a character key, e.g. Delete or Left Arrow
243};
244
246{
249
250 union
251 {
252 // Mouse motion event data, valid when m_eType is k_ERemotePlayInputMouseMotion
254
255 // Mouse button event data, valid when m_eType is k_ERemotePlayInputMouseButtonDown or k_ERemotePlayInputMouseButtonUp
257
258 // Mouse wheel event data, valid when m_eType is k_ERemotePlayInputMouseWheel
260
261 // Key event data, valid when m_eType is k_ERemotePlayInputKeyDown or k_ERemotePlayInputKeyUp
263
264 // Unused space for future use
265 char padding[ 64 - ( sizeof( m_unSessionID ) + sizeof( m_eType ) ) ];
266 };
267};
268//COMPILE_TIME_ASSERT( sizeof( RemotePlayInput_t ) == 64 );
269
270#pragma pack( pop )
271
272
273//-----------------------------------------------------------------------------
274// Purpose: Functions to provide information about Steam Remote Play sessions
275//-----------------------------------------------------------------------------
277{
278public:
279 // Get the number of currently connected Steam Remote Play sessions
280 virtual uint32 GetSessionCount() = 0;
281
282 // Get the currently connected Steam Remote Play session ID at the specified index. Returns zero if index is out of bounds.
283 virtual RemotePlaySessionID_t GetSessionID( int iSessionIndex ) = 0;
284
285 // Return true if the session has joined using a Remote Play Together invitation
286 virtual bool BSessionRemotePlayTogether( RemotePlaySessionID_t unSessionID ) = 0;
287
288 // Get the SteamID of the connected user
290
291 // Get the guest ID of the connected user if they are a Remote Play Together guest
292 // This returns 0 if the sessionID isn't valid or the session isn't a Remote Play Together guest
294
295 // gets the small (32x32) avatar of the connected user, which is a handle to be used in ISteamUtils::GetImageRGBA(), or 0 if the sessionID isn't valid
296 // returns -1 if this image has yet to be loaded, in this case wait for a SteamRemotePlaySessionAvatarLoaded_t callback and then call this again
297 virtual int GetSmallSessionAvatar( RemotePlaySessionID_t unSessionID ) = 0;
298
299 // gets the medium (64x64) avatar of the connected user, which is a handle to be used in ISteamUtils::GetImageRGBA(), or 0 if the sessionID isn't valid
300 // returns -1 if this image has yet to be loaded, in this case wait for a SteamRemotePlaySessionAvatarLoaded_t callback and then call this again
301 virtual int GetMediumSessionAvatar( RemotePlaySessionID_t unSessionID ) = 0;
302
303 // gets the large (184x184) avatar of the connected user, which is a handle to be used in ISteamUtils::GetImageRGBA(), or 0 if the sessionID isn't valid
304 // returns -1 if this image has yet to be loaded, in this case wait for a SteamRemotePlaySessionAvatarLoaded_t callback and then call this again
305 virtual int GetLargeSessionAvatar( RemotePlaySessionID_t unSessionID ) = 0;
306
307 // Get the name of the session client device
308 // This returns NULL if the sessionID is not valid
309 virtual const char *GetSessionClientName( RemotePlaySessionID_t unSessionID ) = 0;
310
311 // Get the form factor of the session client device
313
314 // Get the resolution, in pixels, of the session client device
315 // This is set to 0x0 if the resolution is not available
316 virtual bool BGetSessionClientResolution( RemotePlaySessionID_t unSessionID, int *pnResolutionX, int *pnResolutionY ) = 0;
317
318 // Show the Remote Play Together UI in the game overlay
319 // This returns false if your game is not configured for Remote Play Together
320 virtual bool ShowRemotePlayTogetherUI() = 0;
321
322 // Invite a friend to Remote Play Together, or create a guest invite if steamIDFriend is CSteamID()
323 // This returns false if the invite can't be sent or your game is not configured for Remote Play Together
324 virtual bool BSendRemotePlayTogetherInvite( CSteamID steamIDFriend ) = 0;
325
326 // Make mouse and keyboard input for Remote Play Together sessions available via GetInput() instead of being merged with local input
328
329 // Merge Remote Play Together mouse and keyboard input with local input
331
332 // Get input events from Remote Play Together sessions
333 // This is available after calling BEnableRemotePlayTogetherDirectInput()
334 //
335 // pInput is an array of input events that will be filled in by this function, up to unMaxEvents.
336 // This returns the number of events copied to pInput, or the number of events available if pInput is nullptr.
337 virtual uint32 GetInput( RemotePlayInput_t *pInput, uint32 unMaxEvents ) = 0;
338
339 // Set the mouse cursor visibility for a remote player
340 // This is available after calling BEnableRemotePlayTogetherDirectInput()
341 virtual void SetMouseVisibility( RemotePlaySessionID_t unSessionID, bool bVisible ) = 0;
342
343 // Set the mouse cursor position for a remote player
344 // This is available after calling BEnableRemotePlayTogetherDirectInput()
345 //
346 // This is used to warp the cursor to a specific location and isn't needed during normal event processing.
347 //
348 // The position is normalized relative to the window, where 0,0 is the upper left, and 1,1 is the lower right.
349 virtual void SetMousePosition( RemotePlaySessionID_t unSessionID, float flNormalizedX, float flNormalizedY ) = 0;
350
351 // Create a cursor that can be used with SetMouseCursor()
352 // This is available after calling BEnableRemotePlayTogetherDirectInput()
353 //
354 // Parameters:
355 // nWidth - The width of the cursor, in pixels
356 // nHeight - The height of the cursor, in pixels
357 // nHotX - The X coordinate of the cursor hot spot in pixels, offset from the left of the cursor
358 // nHotY - The Y coordinate of the cursor hot spot in pixels, offset from the top of the cursor
359 // pBGRA - A pointer to the cursor pixels, with 8-bit color channels in red, green, blue, alpha order
360 // nPitch - The distance between pixel rows in bytes, defaults to nWidth * 4
361 virtual RemotePlayCursorID_t CreateMouseCursor( int nWidth, int nHeight, int nHotX, int nHotY, const void *pBGRA, int nPitch = 0 ) = 0;
362
363 // Set the mouse cursor for a remote player
364 // This is available after calling BEnableRemotePlayTogetherDirectInput()
365 //
366 // The cursor ID is a value returned by CreateMouseCursor()
367 virtual void SetMouseCursor( RemotePlaySessionID_t unSessionID, RemotePlayCursorID_t unCursorID ) = 0;
368};
369
370#define STEAMREMOTEPLAY_INTERFACE_VERSION "STEAMREMOTEPLAY_INTERFACE_VERSION004"
371
372// Global interface accessor
375
376// callbacks
377#if defined( VALVE_CALLBACK_PACK_SMALL )
378#pragma pack( push, 4 )
379#elif defined( VALVE_CALLBACK_PACK_LARGE )
380#pragma pack( push, 8 )
381#else
382#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx
383#endif
384
385
386STEAM_CALLBACK_BEGIN( SteamRemotePlaySessionConnected_t, k_iSteamRemotePlayCallbacks + 1 )
389
390
391STEAM_CALLBACK_BEGIN( SteamRemotePlaySessionDisconnected_t, k_iSteamRemotePlayCallbacks + 2 )
394
395
396STEAM_CALLBACK_BEGIN( SteamRemotePlayTogetherGuestInvite_t, k_iSteamRemotePlayCallbacks + 3 )
397 STEAM_CALLBACK_MEMBER_ARRAY( 0, char, m_szConnectURL, 1024 )
399
400
401STEAM_CALLBACK_BEGIN( SteamRemotePlaySessionAvatarLoaded_t, k_iSteamRemotePlayCallbacks + 4 )
402 STEAM_CALLBACK_MEMBER( 0, RemotePlaySessionID_t, m_unSessionID ) // sessionID the avatar has been loaded for
403 STEAM_CALLBACK_MEMBER( 1, int, m_iImage ) // the image index of the now loaded image
404 STEAM_CALLBACK_MEMBER( 2, int, m_iWide ) // width of the loaded image
405 STEAM_CALLBACK_MEMBER( 3, int, m_iTall ) // height of the loaded image
407
408
409#pragma pack( pop )
410
411
412#endif // #define ISTEAMREMOTEPLAY_H
virtual uint32 GetSessionGuestID(RemotePlaySessionID_t unSessionID)=0
virtual const char * GetSessionClientName(RemotePlaySessionID_t unSessionID)=0
virtual bool BGetSessionClientResolution(RemotePlaySessionID_t unSessionID, int *pnResolutionX, int *pnResolutionY)=0
virtual void DisableRemotePlayTogetherDirectInput()=0
virtual bool BSendRemotePlayTogetherInvite(CSteamID steamIDFriend)=0
virtual int GetLargeSessionAvatar(RemotePlaySessionID_t unSessionID)=0
virtual void SetMouseCursor(RemotePlaySessionID_t unSessionID, RemotePlayCursorID_t unCursorID)=0
virtual bool ShowRemotePlayTogetherUI()=0
virtual void SetMousePosition(RemotePlaySessionID_t unSessionID, float flNormalizedX, float flNormalizedY)=0
virtual bool BEnableRemotePlayTogetherDirectInput()=0
virtual void SetMouseVisibility(RemotePlaySessionID_t unSessionID, bool bVisible)=0
virtual RemotePlaySessionID_t GetSessionID(int iSessionIndex)=0
virtual bool BSessionRemotePlayTogether(RemotePlaySessionID_t unSessionID)=0
virtual int GetSmallSessionAvatar(RemotePlaySessionID_t unSessionID)=0
virtual uint32 GetInput(RemotePlayInput_t *pInput, uint32 unMaxEvents)=0
virtual CSteamID GetSessionSteamID(RemotePlaySessionID_t unSessionID)=0
virtual int GetMediumSessionAvatar(RemotePlaySessionID_t unSessionID)=0
virtual RemotePlayCursorID_t CreateMouseCursor(int nWidth, int nHeight, int nHotX, int nHotY, const void *pBGRA, int nPitch=0)=0
virtual uint32 GetSessionCount()=0
virtual ESteamDeviceFormFactor GetSessionClientFormFactor(RemotePlaySessionID_t unSessionID)=0
ERemotePlayInputType
@ k_ERemotePlayInputMouseWheel
@ k_ERemotePlayInputUnknown
@ k_ERemotePlayInputMouseButtonUp
@ k_ERemotePlayInputKeyUp
@ k_ERemotePlayInputKeyDown
@ k_ERemotePlayInputMouseButtonDown
@ k_ERemotePlayInputMouseMotion
ERemotePlayMouseWheelDirection
@ k_ERemotePlayMouseWheelUp
@ k_ERemotePlayMouseWheelRight
@ k_ERemotePlayMouseWheelDown
@ k_ERemotePlayMouseWheelLeft
ESteamDeviceFormFactor
@ k_ESteamDeviceFormFactorComputer
@ k_ESteamDeviceFormFactorUnknown
@ k_ESteamDeviceFormFactorPhone
@ k_ESteamDeviceFormFactorVRHeadset
@ k_ESteamDeviceFormFactorTV
@ k_ESteamDeviceFormFactorTablet
uint32 RemotePlayCursorID_t
ERemotePlayMouseButton
@ k_ERemotePlayMouseButtonX1
@ k_ERemotePlayMouseButtonMiddle
@ k_ERemotePlayMouseButtonLeft
@ k_ERemotePlayMouseButtonX2
@ k_ERemotePlayMouseButtonRight
uint32 RemotePlaySessionID_t
#define STEAMREMOTEPLAY_INTERFACE_VERSION
ERemotePlayKeyModifier
@ k_ERemotePlayKeyModifierLeftGUI
@ k_ERemotePlayKeyModifierNumLock
@ k_ERemotePlayKeyModifierRightGUI
@ k_ERemotePlayKeyModifierLeftShift
@ k_ERemotePlayKeyModifierCapsLock
@ k_ERemotePlayKeyModifierRightAlt
@ k_ERemotePlayKeyModifierRightControl
@ k_ERemotePlayKeyModifierRightShift
@ k_ERemotePlayKeyModifierNone
@ k_ERemotePlayKeyModifierLeftAlt
@ k_ERemotePlayKeyModifierMask
@ k_ERemotePlayKeyModifierLeftControl
ERemotePlayScancode
@ k_ERemotePlayScancodeKeypad4
@ k_ERemotePlayScancodeRightShift
@ k_ERemotePlayScancodeF1
@ k_ERemotePlayScancodeF2
@ k_ERemotePlayScancodeG
@ k_ERemotePlayScancode6
@ k_ERemotePlayScancodeL
@ k_ERemotePlayScancodeP
@ k_ERemotePlayScancodeS
@ k_ERemotePlayScancodePageDown
@ k_ERemotePlayScancodeRightALT
@ k_ERemotePlayScancodeU
@ k_ERemotePlayScancodeF8
@ k_ERemotePlayScancodeCapsLock
@ k_ERemotePlayScancodeRightGUI
@ k_ERemotePlayScancodeEscape
@ k_ERemotePlayScancodeR
@ k_ERemotePlayScancode4
@ k_ERemotePlayScancodeReturn
@ k_ERemotePlayScancode8
@ k_ERemotePlayScancodeSpace
@ k_ERemotePlayScancode1
@ k_ERemotePlayScancode0
@ k_ERemotePlayScancodePeriod
@ k_ERemotePlayScancodeQ
@ k_ERemotePlayScancodeLeftBracket
@ k_ERemotePlayScancodePageUp
@ k_ERemotePlayScancode2
@ k_ERemotePlayScancode5
@ k_ERemotePlayScancodeF7
@ k_ERemotePlayScancodeKeypad2
@ k_ERemotePlayScancodeLeft
@ k_ERemotePlayScancodeEnd
@ k_ERemotePlayScancodeF12
@ k_ERemotePlayScancodeLeftAlt
@ k_ERemotePlayScancodeF9
@ k_ERemotePlayScancodeC
@ k_ERemotePlayScancodeF10
@ k_ERemotePlayScancodeKeypad7
@ k_ERemotePlayScancodeGrave
@ k_ERemotePlayScancodeBackspace
@ k_ERemotePlayScancodeApostrophe
@ k_ERemotePlayScancode7
@ k_ERemotePlayScancodeKeypad9
@ k_ERemotePlayScancodeUp
@ k_ERemotePlayScancodeF
@ k_ERemotePlayScancodeKeypad1
@ k_ERemotePlayScancode9
@ k_ERemotePlayScancodeZ
@ k_ERemotePlayScancodeUnknown
@ k_ERemotePlayScancodeKeypadEnter
@ k_ERemotePlayScancodeKeypad5
@ k_ERemotePlayScancodeLeftShift
@ k_ERemotePlayScancodeKeypad3
@ k_ERemotePlayScancodeM
@ k_ERemotePlayScancodeY
@ k_ERemotePlayScancodeE
@ k_ERemotePlayScancodeF11
@ k_ERemotePlayScancodeD
@ k_ERemotePlayScancodeKeypad8
@ k_ERemotePlayScancodeTab
@ k_ERemotePlayScancodeV
@ k_ERemotePlayScancodeHome
@ k_ERemotePlayScancodeK
@ k_ERemotePlayScancodeInsert
@ k_ERemotePlayScancodeMinus
@ k_ERemotePlayScancodeF6
@ k_ERemotePlayScancodeKeypad0
@ k_ERemotePlayScancodeComma
@ k_ERemotePlayScancodeLeftControl
@ k_ERemotePlayScancodeRightControl
@ k_ERemotePlayScancodeEquals
@ k_ERemotePlayScancodeKeypadMinus
@ k_ERemotePlayScancodeJ
@ k_ERemotePlayScancodeF5
@ k_ERemotePlayScancodeO
@ k_ERemotePlayScancodeI
@ k_ERemotePlayScancodeT
@ k_ERemotePlayScancodeF3
@ k_ERemotePlayScancodeDown
@ k_ERemotePlayScancodeKeypadDivide
@ k_ERemotePlayScancodeSemicolon
@ k_ERemotePlayScancodeA
@ k_ERemotePlayScancodeW
@ k_ERemotePlayScancodeKeypadPeriod
@ k_ERemotePlayScancodeX
@ k_ERemotePlayScancodeF4
@ k_ERemotePlayScancodeKeypadPlus
@ k_ERemotePlayScancodeB
@ k_ERemotePlayScancodeKeypad6
@ k_ERemotePlayScancodeSlash
@ k_ERemotePlayScancodeH
@ k_ERemotePlayScancodeN
@ k_ERemotePlayScancodeRightBracket
@ k_ERemotePlayScancodeKeypadMultiply
@ k_ERemotePlayScancodeBackslash
@ k_ERemotePlayScancode3
@ k_ERemotePlayScancodeDelete
@ k_ERemotePlayScancodeRight
@ k_ERemotePlayScancodeLeftGUI
ISteamRemotePlay * SteamRemotePlay()
const char *typedef uint32(S_CALLTYPE *SteamAPI_CheckCallbackRegistered_t)(int iCallbackNum)
#define STEAM_DEFINE_USER_INTERFACE_ACCESSOR(type, name, version)
#define STEAM_CALLBACK_END(nArgs)
@ k_iSteamRemotePlayCallbacks
#define STEAM_CALLBACK_MEMBER(varidx, vartype, varname)
#define STEAM_CALLBACK_BEGIN(callbackname, callbackid)
#define STEAM_CALLBACK_MEMBER_ARRAY(varidx, vartype, varname, varcount)
ERemotePlayInputType m_eType
RemotePlaySessionID_t m_unSessionID
ERemotePlayMouseWheelDirection m_eDirection
RemotePlayInputMouseWheel_t m_MouseWheel
ERemotePlayMouseButton m_eMouseButton
RemotePlayInputMouseMotion_t m_MouseMotion
char padding[64 -(sizeof(m_unSessionID)+sizeof(m_eType))]