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

From Spesoft/GameEx Wiki
Jump to navigation Jump to search
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
==<span style="font-size:125%; color:darkblue;">GameEx: Input Keyboard Function Overview</span>==
This function is called when the user presses a button on the keyboard.
This function is called when you press a button on the keyboard.
<br />
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.
<div class="note_block_red"><b>PLEASE NOTE:</b> ''This function only fires when the GameEx UI is visible.''</div>
The <span style="color:red;">'''Code'''</span> and <span style="color:red;">'''UsingDirectInput'''</span> parameters are passed as the user presses a keyboard key.  
<br />
<br /><br />
== <span class="plugin_headline_text">Parameters</span> ==
<span style="color:darkred;"><b>PLEASE NOTE:</b> ''This function only fires when the GameEx UI is visible.''</span>
<span class="plugin_return_text">Code [integer]</span>: The key code of the button pressed.<br />
<span class="plugin_return_text">UsingDirectInput [boolean]</span>: Specifies the Direct Input method.<br />
<br />
=== <span class="plugin_text_fx">Parameter Values</span> ===
The <span class="plugin_return_text">Code integer</span> is a constant, based on the key codes used by Windows. You can learn more about the various vKey codes [http://msdn.microsoft.com/en-us/library/windows/desktop/dd375731(v=vs.85).aspx at MSDN].<br />
The <span class="plugin_return_text">UsingDirectInput boolean</span> is passed as <span class="plugin_return_text">true</span> if Direct Input mode has been detected.
<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 keyboard key.<br />
Return <span class="plugin_return_text">false</span> and GameEx will not process keyboard key.
<br />
== <span class="plugin_headline_text">Code Examples</span> ==


==Code Examples==
=== <span class="plugin_text_fx">VB.NET</span> ===
 
<pre class="code_vb">
<span style="font-size:125%; color:#003300;"><b>VB.NET syntax:</b></span>
<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
     Return True
     Return True
End Function</pre>
End Function</pre>


<span style="font-size:125%; color:#003300;"><b>C# syntax:</b></span>
=== <span class="plugin_text_fx">C#</span> ===
<pre style="font-family:'Lucida Console', Monaco, monospace; border-color:#003300; background-color:#E0EEE0; border-style:solid;">
<pre class="code_cs">
public bool Input_Keyboard(int code, bool usingdirectinput)
public bool Input_Keyboard(int code, bool usingdirectinput)
{
{
     return true;
     return true;
}</pre>
}</pre>
 
<br />
[[Category:PlugIn Development]]
[[Category:PlugIn Development]]

Latest revision as of 07:15, 28 April 2014

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

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


Parameters

Code [integer]: The key code of the button pressed.
UsingDirectInput [boolean]: Specifies the Direct Input method.

Parameter Values

The Code integer is a constant, based on the key codes used by Windows. You can learn more about the various vKey codes at MSDN.
The UsingDirectInput boolean is passed as true if Direct Input mode has been detected.

Returns

This function returns a boolean value.

Return Values

Return true and GameEx will process the keyboard key.
Return false and GameEx will not process keyboard key.

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