Difference between revisions of "PlugIn Development:GameEx Input MCE Remote Function"

From Spesoft/GameEx Wiki
Jump to navigation Jump to search
Line 1: Line 1:
==<span style="font-size:125%; color:darkblue;">GameEx: Input MCE Remote Function Overview</span>==
This function is called when you press a button on the MCE remote.
This function is called when you press a button on the MCE remote.
You can return <span style="color:red;">'''TRUE'''</span> to continue processing the event or return <span style="color:red;">'''FALSE'''</span> and GameEx will not initialize the event.
You can return <span style="color:red;">'''TRUE'''</span> to continue processing the event or return <span style="color:red;">'''FALSE'''</span> and GameEx will not initialize the event.
Line 6: Line 5:
<span style="color:darkred;"><b>PLEASE NOTE:</b> ''This function only fires when the GameEx UI is visible.''</span>
<span style="color:darkred;"><b>PLEASE NOTE:</b> ''This function only fires when the GameEx UI is visible.''</span>


==Code Examples==
== <span style="color:darkblue;">Code Examples</span> ==


<span style="font-size:125%; color:#003300;"><b>VB.NET syntax:</b></span>
=== <span style="color:#003300;">VB.NET</span> ===
==== Enumerations ====
===== Key Enumeration =====
<pre style="font-family:'Lucida Console', Monaco, monospace; border-color:#003300; background-color:#E0EEE0; border-style:dashed;">
<pre style="font-family:'Lucida Console', Monaco, monospace; border-color:#003300; background-color:#E0EEE0; border-style:dashed;">
Public Enum MCE_Remote_Key
Public Enum MCE_Remote_Key
Line 29: Line 30:
     MCEButton_Number0_2 = 58
     MCEButton_Number0_2 = 58
End Enum</pre>
End Enum</pre>
 
===== Command Enumeration =====
<pre style="font-family:'Lucida Console', Monaco, monospace; border-color:#003300; background-color:#E0EEE0; border-style:dashed;">
<pre style="font-family:'Lucida Console', Monaco, monospace; border-color:#003300; background-color:#E0EEE0; border-style:dashed;">
Public Enum MCE_Remote_Command
Public Enum MCE_Remote_Command
Line 44: Line 45:
     MCEButton_ChannelDown = 271843328
     MCEButton_ChannelDown = 271843328
End Enum</pre>
End Enum</pre>
 
===== Raw Enumeration =====
<pre style="font-family:'Lucida Console', Monaco, monospace; border-color:#003300; background-color:#E0EEE0; border-style:dashed;">
<pre style="font-family:'Lucida Console', Monaco, monospace; border-color:#003300; background-color:#E0EEE0; border-style:dashed;">
Public Enum MCE_Remote_Raw
Public Enum MCE_Remote_Raw
Line 65: Line 66:
     MCEButton_VolumeDown = 234
     MCEButton_VolumeDown = 234
End Enum</pre>
End Enum</pre>
 
==== Function ====
<pre style="font-family:'Lucida Console', Monaco, monospace; border-color:#003300; background-color:#E0EEE0; border-style:solid;">
<pre style="font-family:'Lucida Console', Monaco, monospace; border-color:#003300; background-color:#E0EEE0; border-style:solid;">
Public Function Input_MCERemote(ByVal Key As Integer, ByVal Command As Integer, ByVal Raw As Integer) As Boolean
Public Function Input_MCERemote(ByVal Key As Integer, ByVal Command As Integer, ByVal Raw As Integer) As Boolean
Line 170: Line 171:
End Function</pre>
End Function</pre>


<span style="font-size:125%; color:#003300;"><b>C# syntax:</b></span>
=== <span style="color:#003300;">C#</span> ===
==== Enumerations ====
===== Key Enumeration =====
<pre style="font-family:'Lucida Console', Monaco, monospace; border-color:#003300; background-color:#E0EEE0; border-style:dashed;">
<pre style="font-family:'Lucida Console', Monaco, monospace; border-color:#003300; background-color:#E0EEE0; border-style:dashed;">
public enum MCE_Remote_Key : uint
public enum MCE_Remote_Key : uint
Line 192: Line 195:
     MCEButton_Number0_2 = 58,
     MCEButton_Number0_2 = 58,
}</pre>
}</pre>
 
===== Command Enumeration =====
<pre style="font-family:'Lucida Console', Monaco, monospace; border-color:#003300; background-color:#E0EEE0; border-style:dashed;">
<pre style="font-family:'Lucida Console', Monaco, monospace; border-color:#003300; background-color:#E0EEE0; border-style:dashed;">
public enum MCE_Remote_Command : uint
public enum MCE_Remote_Command : uint
Line 208: Line 211:
     MCEButton_ChannelDown = 271843328,
     MCEButton_ChannelDown = 271843328,
}</pre>
}</pre>
 
===== Raw Enumeration =====
<pre style="font-family:'Lucida Console', Monaco, monospace; border-color:#003300; background-color:#E0EEE0; border-style:dashed;">
<pre style="font-family:'Lucida Console', Monaco, monospace; border-color:#003300; background-color:#E0EEE0; border-style:dashed;">
public enum MCE_Remote_Raw : uint
public enum MCE_Remote_Raw : uint
Line 230: Line 233:
     MCEButton_VolumeDown = 234,
     MCEButton_VolumeDown = 234,
}</pre>
}</pre>
 
==== Function ====
<pre style="font-family:'Lucida Console', Monaco, monospace; border-color:#003300; background-color:#E0EEE0; border-style:solid;">
<pre style="font-family:'Lucida Console', Monaco, monospace; border-color:#003300; background-color:#E0EEE0; border-style:solid;">
public bool Input_MCERemote(uint Key, uint Command, uint Raw)
public bool Input_MCERemote(uint Key, uint Command, uint Raw)
Line 338: Line 341:
   return true;
   return true;
}</pre>
}</pre>
 
<br />
[[Category:PlugIn Development]]
[[Category:PlugIn Development]]

Revision as of 06:23, 27 April 2014

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

Enumerations

Key Enumeration
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
Command Enumeration
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
Raw Enumeration
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

Function

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#

Enumerations

Key Enumeration
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,
}
Command Enumeration
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,
}
Raw Enumeration
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,
}

Function

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;
}