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:
This function is called when you press a button on the MCE remote.
This function is called when the user presses 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.
The <span style="color:red;">'''Key, Command,'''</span> and <span style="color:red;">'''Raw'''</span> parameters are passed to this function as the user presses a remote button.  
<br /><br />
<br /><br />
<span style="color:darkred;"><b>PLEASE NOTE:</b> ''This function only fires when the GameEx UI is visible.''</span>
<div class="note_block_red"><b>PLEASE NOTE:</b> ''This function only fires when the GameEx UI is visible.''</div>
<br />
== <span class="plugin_headline_text">Parameters</span> ==
<span class="plugin_return_text">Key [integer]</span>: A number representing the key code.<br />
<span class="plugin_return_text">Command [integer]</span>: A number representing the command code.<br />
<span class="plugin_return_text">Raw [integer]</span>: A number representing the raw code.<br />
<br />
=== <span class="plugin_text_fx">Parameter Values</span> ===
The <span class="plugin_return_text">Key integer</span> can be converted to an <span class="plugin_return_text">MCE_Remote_Key</span> via the supplied <span class="plugin_return_text">enumeration</span>.<br />
The <span class="plugin_return_text">Command integer</span> can be converted to an <span class="plugin_return_text">MCE_Remote_Command</span> via the supplied <span class="plugin_return_text">enumeration</span>. <br />
The <span class="plugin_return_text">Raw integer</span> can be converted to an <span class="plugin_return_text">MCE_Remote_Raw</span> via the supplied <span class="plugin_return_text">enumeration</span>.
<br />
== <span class="plugin_headline_text">Returns</span> ==
This function returns a <span class="plugin_return_text">boolean</span> value.
<br />
=== <span class="plugin_text_fx">Return Values</span> ===
Return <span class="plugin_return_text">true</span> and GameEx will process the MCE Remote button press.<br />
Return <span class="plugin_return_text">false</span> and GameEx will not process the MCE Remote button press.
<br />
== <span class="plugin_headline_text">Code Examples</span> ==


== <span style="color:darkblue;">Code Examples</span> ==
=== <span class="plugin_text_fx">VB.NET</span> ===
 
=== <span style="color:#003300;">VB.NET</span> ===
----
==== <span style="color:purple;">Enumerations</span> ====
==== <span style="color:purple;">Enumerations</span> ====
===== <span style="color:orange;">Key Enumeration</span> =====
===== <span style="color:orange;">Key Enumeration</span> =====
<pre style="font-family:'Lucida Console', Monaco, monospace; border-color:#003300; background-color:#E0EEE0; border-style:dashed;">
<pre class="code_block_enum">
Public Enum MCE_Remote_Key
Public Enum MCE_Remote_Key
     MCEButton_OK = 13
     MCEButton_OK = 13
Line 32: Line 46:
End Enum</pre>
End Enum</pre>
===== <span style="color:orange;">Command Enumeration</span> =====
===== <span style="color:orange;">Command Enumeration</span> =====
<pre style="font-family:'Lucida Console', Monaco, monospace; border-color:#003300; background-color:#E0EEE0; border-style:dashed;">
<pre class="code_block_enum">
Public Enum MCE_Remote_Command
Public Enum MCE_Remote_Command
     MCEButton_Back = 65536
     MCEButton_Back = 65536
Line 47: Line 61:
End Enum</pre>
End Enum</pre>
===== <span style="color:orange;">Raw Enumeration</span> =====
===== <span style="color:orange;">Raw Enumeration</span> =====
<pre style="font-family:'Lucida Console', Monaco, monospace; border-color:#003300; background-color:#E0EEE0; border-style:dashed;">
<pre class="code_block_enum">
Public Enum MCE_Remote_Raw
Public Enum MCE_Remote_Raw
     MCEButton_MoreInfo = 9
     MCEButton_MoreInfo = 9
Line 68: Line 82:
End Enum</pre>
End Enum</pre>
==== <span style="color:purple;">Function</span> ====
==== <span style="color:purple;">Function</span> ====
<pre style="font-family:'Lucida Console', Monaco, monospace; border-color:#003300; background-color:#E0EEE0; border-style:solid;">
<pre class="code_block_func">
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
   Select Case Key
   Select Case Key
Line 172: Line 186:
End Function</pre>
End Function</pre>


=== <span style="color:#003300;">C#</span> ===
=== <span class="plugin_text_fx">C#</span> ===
----
==== <span style="color:purple;">Enumerations</span> ====
==== <span style="color:purple;">Enumerations</span> ====
===== <span style="color:orange;">Key Enumeration</span> =====
===== <span style="color:orange;">Key Enumeration</span> =====
<pre style="font-family:'Lucida Console', Monaco, monospace; border-color:#003300; background-color:#E0EEE0; border-style:dashed;">
<pre class="code_block_enum">
public enum MCE_Remote_Key : uint
public enum MCE_Remote_Key : uint
{
{
Line 198: Line 211:
}</pre>
}</pre>
===== <span style="color:orange;">Command Enumeration</span> =====
===== <span style="color:orange;">Command Enumeration</span> =====
<pre style="font-family:'Lucida Console', Monaco, monospace; border-color:#003300; background-color:#E0EEE0; border-style:dashed;">
<pre class="code_block_enum">
public enum MCE_Remote_Command : uint
public enum MCE_Remote_Command : uint
{
{
Line 214: Line 227:
}</pre>
}</pre>
===== <span style="color:orange;">Raw Enumeration</span> =====
===== <span style="color:orange;">Raw Enumeration</span> =====
<pre style="font-family:'Lucida Console', Monaco, monospace; border-color:#003300; background-color:#E0EEE0; border-style:dashed;">
<pre class="code_block_enum">
public enum MCE_Remote_Raw : uint
public enum MCE_Remote_Raw : uint
{
{
Line 236: Line 249:
}</pre>
}</pre>
==== <span style="color:purple;">Function</span> ====
==== <span style="color:purple;">Function</span> ====
<pre style="font-family:'Lucida Console', Monaco, monospace; border-color:#003300; background-color:#E0EEE0; border-style:solid;">
<pre class="code_block_func">
public bool Input_MCERemote(uint Key, uint Command, uint Raw)
public bool Input_MCERemote(uint Key, uint Command, uint Raw)
{
{

Revision as of 01:16, 28 April 2014

This function is called when the user presses a button on the MCE remote.

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


Parameters

Key [integer]: A number representing the key code.
Command [integer]: A number representing the command code.
Raw [integer]: A number representing the raw code.

Parameter Values

The Key integer can be converted to an MCE_Remote_Key via the supplied enumeration.
The Command integer can be converted to an MCE_Remote_Command via the supplied enumeration.
The Raw integer can be converted to an MCE_Remote_Raw via the supplied enumeration.

Returns

This function returns a boolean value.

Return Values

Return true and GameEx will process the MCE Remote button press.
Return false and GameEx will not process the MCE Remote button press.

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