Difference between revisions of "PlugIn Development:GameEx Input Keyboard Function"

From Spesoft/GameEx Wiki
Jump to navigation Jump to search
Line 1: Line 1:
==<span style="font-size:125%; color:darkblue;">GameEx: Input Keyboard Function Overview</span>==
This function is called when you press a button on the keyboard.
This function is called when you press a button on the keyboard.
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 keyboard 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 keyboard 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> ===
<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_Keyboard(ByVal code As Integer, ByVal usingdirectinput As Boolean) As Boolean
Public Function Input_Keyboard(ByVal code As Integer, ByVal usingdirectinput As Boolean) As Boolean
Line 14: Line 13:
End Function</pre>
End Function</pre>


<span style="font-size:125%; color:#003300;"><b>C# syntax:</b></span>
=== <span style="color:#003300;">C#</span> ===
<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_Keyboard(int code, bool usingdirectinput)
public bool Input_Keyboard(int code, bool usingdirectinput)
Line 20: Line 19:
     return true;
     return true;
}</pre>
}</pre>
 
<br />
[[Category:PlugIn Development]]
[[Category:PlugIn Development]]

Revision as of 06:18, 27 April 2014

This function is called when you press a button on the keyboard. You can return TRUE to continue processing the event or return FALSE and GameEx will not initialize the keyboard event. The Code and UsingDirectInput parameters are passed as the user presses a keyboard key.

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

Code Examples

VB.NET

Public Function Input_Keyboard(ByVal code As Integer, ByVal usingdirectinput As Boolean) As Boolean
     Return True
End Function

C#

public bool Input_Keyboard(int code, bool usingdirectinput)
{	
     return true;
}