PlugIn Development:GameEx Input MCE Remote Function

From Spesoft/GameEx Wiki
Jump to navigation Jump to search

GameEx: Input MCE Remote Function Overview

This function is called when you press a button on the MCE remote. You can return TRUE to continue processing the event or return FALSE and GameEx will not initialize the event. The Key, Command, and Raw parameters are passed to this function as the user presses a remote button.

PLEASE NOTE: This function only fires when the GameEx UI is visible.

Code Examples

VB.NET syntax:

Public Enum MCE_Remote_Key
     MCEButton_OK = 13
     MCEButton_Clear = 27
     MCEButton_MoveLeft = 37
     MCEButton_MoveUp = 38
     MCEButton_MoveRight = 39
     MCEButton_MoveDown = 40
     MCEButton_Number0 = 48
     MCEButton_Number1 = 49
     MCEButton_Number2 = 50
     MCEButton_Number3 = 51
     MCEButton_Number4 = 52
     MCEButton_Number5 = 53
     MCEButton_Number6 = 54
     MCEButton_Number7 = 55
     MCEButton_Number8 = 56
     MCEButton_Number9 = 57
     MCEButton_Number0_2 = 58
End Enum
Public Enum MCE_Remote_Command
     MCEButton_Back = 65536
     MCEButton_Skip = 720896
     MCEButton_Replay = 786432
     MCEButton_Stop = 851968
     MCEButton_Play = 271450112
     MCEButton_Pause = 271515648
     MCEButton_Record = 271581184
     MCEButton_Forward = 271646720
     MCEButton_Rewind = 271712256
     MCEButton_ChannelUp = 271777792
     MCEButton_ChannelDown = 271843328
End Enum
Public Enum MCE_Remote_Raw
     MCEButton_MoreInfo = 9
     MCEButton_DVDMenu = 36
     MCEButton_LiveTV = 37
     MCEButton_MyTV = 70
     MCEButton_MyMusic = 71
     MCEButton_RecordedTV = 72
     MCEButton_MyPictures = 73
     MCEButton_MyVideos = 74
     MCEButton_DVDAngle = 75
     MCEButton_DVDAudio = 76
     MCEButton_DVDSubtitle = 77
     MCEButton_OEM1 = 128
     MCEButton_OEM2 = 129
     MCEButton_Guide = 141
     MCEButton_Mute = 226
     MCEButton_VolumeUp = 233
     MCEButton_VolumeDown = 234
End Enum
Public Function Input_MCERemote(ByVal Key As Integer, ByVal Command As Integer, ByVal Raw As Integer) As Boolean
   Select Case Key
       Case MCE_Remote_Key.MCEButton_OK
          Exit Select
       Case MCE_Remote_Key.MCEButton_Clear
          Exit Select
       Case MCE_Remote_Key.MCEButton_MoveLeft
          Exit Select
       Case MCE_Remote_Key.MCEButton_MoveUp
          Exit Select
       Case MCE_Remote_Key.MCEButton_MoveRight
          Exit Select
       Case MCE_Remote_Key.MCEButton_MoveDown
          Exit Select
       Case MCE_Remote_Key.MCEButton_Number0
          Exit Select
       Case MCE_Remote_Key.MCEButton_Number1
          Exit Select
       Case MCE_Remote_Key.MCEButton_Number2
          Exit Select
       Case MCE_Remote_Key.MCEButton_Number3
          Exit Select
       Case MCE_Remote_Key.MCEButton_Number4
          Exit Select
       Case MCE_Remote_Key.MCEButton_Number5
          Exit Select
       Case MCE_Remote_Key.MCEButton_Number6
          Exit Select
       Case MCE_Remote_Key.MCEButton_Number7
          Exit Select
       Case MCE_Remote_Key.MCEButton_Number8
          Exit Select
       Case MCE_Remote_Key.MCEButton_Number9
          Exit Select
       Case MCE_Remote_Key.MCEButton_Number0_2
          Exit Select
   End Select

   Select Case Command
       Case MCE_Remote_Command.MCEButton_Back
          Exit Select
       Case MCE_Remote_Command.MCEButton_Skip
          Exit Select       
       Case MCE_Remote_Command.MCEButton_Replay
          Exit Select
       Case MCE_Remote_Command.MCEButton_Stop
          Exit Select
       Case MCE_Remote_Command.MCEButton_Play
          Exit Select
       Case MCE_Remote_Command.MCEButton_Pause
          Exit Select
       Case MCE_Remote_Command.MCEButton_Record
          Exit Select
       Case MCE_Remote_Command.MCEButton_Forward
          Exit Select
       Case MCE_Remote_Command.MCEButton_Rewind
          Exit Select
       Case MCE_Remote_Command.MCEButton_ChannelUp
          Exit Select
       Case MCE_Remote_Command.MCEButton_ChannelDown
          Exit Select
   End Select

   Select Case Raw
       Case MCE_Remote_Raw.MCEButton_MoreInfo
          Exit Select
       Case MCE_Remote_Raw.MCEButton_DVDMenu
          Exit Select
       Case MCE_Remote_Raw.MCEButton_LiveTV
          Exit Select
       Case MCE_Remote_Raw.MCEButton_MyTV
          Exit Select
       Case MCE_Remote_Raw.MCEButton_MyMusic
          Exit Select
       Case MCE_Remote_Raw.MCEButton_RecordedTV
          Exit Select
       Case MCE_Remote_Raw.MCEButton_MyPictures
          Exit Select
       Case MCE_Remote_Raw.MCEButton_MyVideos
          Exit Select
       Case MCE_Remote_Raw.MCEButton_DVDAngle
          Exit Select
       Case MCE_Remote_Raw.MCEButton_DVDAudio
          Exit Select
       Case MCE_Remote_Raw.MCEButton_DVDSubtitle
          Exit Select
       Case MCE_Remote_Raw.MCEButton_OEM1
          Exit Select
       Case MCE_Remote_Raw.MCEButton_OEM2
          Exit Select
       Case MCE_Remote_Raw.MCEButton_Guide
          Exit Select
       Case MCE_Remote_Raw.MCEButton_Mute
          Exit Select
       Case MCE_Remote_Raw.MCEButton_VolumeUp
          Exit Select
       Case MCE_Remote_Raw.MCEButton_VolumeDown
          Exit Select
   End Select

   Return True
End Function

C# syntax:

public enum MCE_Remote_Key : uint
{
     MCEButton_OK = 13,
     MCEButton_Clear = 27,
     MCEButton_MoveLeft = 37,
     MCEButton_MoveUp = 38,
     MCEButton_MoveRight = 39,
     MCEButton_MoveDown = 40,
     MCEButton_Number0 = 48,
     MCEButton_Number1 = 49,
     MCEButton_Number2 = 50,
     MCEButton_Number3 = 51,
     MCEButton_Number4 = 52,
     MCEButton_Number5 = 53,
     MCEButton_Number6 = 54,
     MCEButton_Number7 = 55,
     MCEButton_Number8 = 56,
     MCEButton_Number9 = 57,
     MCEButton_Number0_2 = 58,
}
public enum MCE_Remote_Command : uint
{
     MCEButton_Back = 65536,
     MCEButton_Skip = 720896,
     MCEButton_Replay = 786432,
     MCEButton_Stop = 851968,
     MCEButton_Play = 271450112,
     MCEButton_Pause = 271515648,
     MCEButton_Record = 271581184,
     MCEButton_Forward = 271646720,
     MCEButton_Rewind = 271712256,
     MCEButton_ChannelUp = 271777792,
     MCEButton_ChannelDown = 271843328,
}
public enum MCE_Remote_Raw : uint
{
     MCEButton_MoreInfo = 9,
     MCEButton_DVDMenu = 36,
     MCEButton_LiveTV = 37,
     MCEButton_MyTV = 70,
     MCEButton_MyMusic = 71,
     MCEButton_RecordedTV = 72,
     MCEButton_MyPictures = 73,
     MCEButton_MyVideos = 74,
     MCEButton_DVDAngle = 75,
     MCEButton_DVDAudio = 76,
     MCEButton_DVDSubtitle = 77,
     MCEButton_OEM1 = 128,
     MCEButton_OEM2 = 129,
     MCEButton_Guide = 141,
     MCEButton_Mute = 226,
     MCEButton_VolumeUp = 233,
     MCEButton_VolumeDown = 234,
}
public bool Input_MCERemote(uint Key, uint Command, uint Raw)
{
   switch (Key)
   {
     case (uint) MCE_Remote_Key.MCEButton_OK:
	break;
     case (uint) MCE_Remote_Key.MCEButton_Clear:
	break;
     case (uint) MCE_Remote_Key.MCEButton_MoveLeft:
	break;
     case (uint) MCE_Remote_Key.MCEButton_MoveUp:
	break;
     case (uint) MCE_Remote_Key.MCEButton_MoveRight:
	break;
     case (uint) MCE_Remote_Key.MCEButton_MoveDown:
	break;
     case (uint) MCE_Remote_Key.MCEButton_Number0:
	break;
     case (uint) MCE_Remote_Key.MCEButton_Number1:
	break;
     case (uint) MCE_Remote_Key.MCEButton_Number2:
	break;
     case (uint) MCE_Remote_Key.MCEButton_Number3:
	break;
     case (uint) MCE_Remote_Key.MCEButton_Number4:
	break;
     case (uint) MCE_Remote_Key.MCEButton_Number5:
	break;
     case (uint) MCE_Remote_Key.MCEButton_Number6:
	break;
     case (uint) MCE_Remote_Key.MCEButton_Number7:
	break;
     case (uint) MCE_Remote_Key.MCEButton_Number8:
	break;
     case (uint) MCE_Remote_Key.MCEButton_Number9:
	break;
     case (uint) MCE_Remote_Key.MCEButton_Number0_2:
	     break;
   }

   switch(Command)
   {
     case (uint) MCE_Remote_Command.MCEButton_Back:
	break;
     case (uint) MCE_Remote_Command.MCEButton_Skip:
	break;
     case (uint) MCE_Remote_Command.MCEButton_Replay:
	break;
     case (uint) MCE_Remote_Command.MCEButton_Stop:
	break;
     case (uint) MCE_Remote_Command.MCEButton_Play:
	break;
     case (uint) MCE_Remote_Command.MCEButton_Pause:
	break;
     case (uint) MCE_Remote_Command.MCEButton_Record:
	break;
     case (uint) MCE_Remote_Command.MCEButton_Forward:
	break;
     case (uint) MCE_Remote_Command.MCEButton_Rewind:
	break;
     case (uint) MCE_Remote_Command.MCEButton_ChannelUp:
	break;
     case (uint) MCE_Remote_Command.MCEButton_ChannelDown:
	break;
   }

   switch(Raw)
   {
     case (uint) MCE_Remote_Raw.MCEButton_MoreInfo:
	break;
     case (uint) MCE_Remote_Raw.MCEButton_DVDMenu:
	break;
     case (uint) MCE_Remote_Raw.MCEButton_LiveTV:
	break;
     case (uint) MCE_Remote_Raw.MCEButton_MyTV:
	break;
     case (uint) MCE_Remote_Raw.MCEButton_MyMusic:
	break;
     case (uint) MCE_Remote_Raw.MCEButton_RecordedTV:
	break;
     case (uint) MCE_Remote_Raw.MCEButton_MyPictures:
	break;
     case (uint) MCE_Remote_Raw.MCEButton_MyVideos:
	break;
     case (uint) MCE_Remote_Raw.MCEButton_DVDAngle:
        break;
     case (uint) MCE_Remote_Raw.MCEButton_DVDAudio:
	break;
     case (uint) MCE_Remote_Raw.MCEButton_DVDSubtitle:
	break;
     case (uint) MCE_Remote_Raw.MCEButton_OEM1:
	break;
     case (uint) MCE_Remote_Raw.MCEButton_OEM2:
	break;
     case (uint) MCE_Remote_Raw.MCEButton_Guide:
        break;
     case (uint) MCE_Remote_Raw.MCEButton_Mute:
	break;
     case (uint) MCE_Remote_Raw.MCEButton_VolumeUp:
	break;
     case (uint) MCE_Remote_Raw.MCEButton_VolumeDown:
	break;
   }

   return true;
}