Sorry for the double post, but I have yet another question, and didn't want to create a new thread to ask it.
Is there someone who can tell me how to convert a string (a letter, ie "k") to the integer that DirectInput uses?
I tried using SKey = CapChar, which returns the following error:
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.InvalidCastException: Cast from string "k" to type 'Integer' is not valid. ---> System.FormatException: Input string was not in a correct format.
at Microsoft.VisualBasic.CompilerServices.DoubleType.Parse(String Value, NumberFormatInfo NumberFormat)
at Microsoft.VisualBasic.CompilerServices.DoubleType.Parse(String Value)
at Microsoft.VisualBasic.CompilerServices.IntegerType.FromString(String Value)
--- End of inner exception stack trace ---
at Microsoft.VisualBasic.CompilerServices.IntegerType.FromString(String Value)
at Halo_Screencap.frmMain.DIWatch_Tick(Object sender, EventArgs e) in C:\Documents and Settings\The 4Life Network\My Documents\Visual Studio Projects\Halo Screencap\frmMain.vb:line 771
at System.Windows.Forms.Timer.OnTick(EventArgs e)
at System.Windows.Forms.Timer.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr idEvent, IntPtr dwTime)
************** Loaded Assemblies **************
mscorlib
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase: file:///c:/windows/microsoft.net/framework/v1.1.4322/mscorlib.dll
----------------------------------------
HSC
Assembly Version: 1.0.2051.21692
Win32 Version: 1.0.2051.21692
CodeBase: file:///C:/Documents%20and%20Settings/The%204Life%20Network/My%20Documents/Visual%20Studio%20Projects/Halo%20Screencap/bin/HSC.exe
----------------------------------------
System.Windows.Forms
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase: file:///c:/windows/assembly/gac/system.windows.forms/1.0.5000.0__b77a5c561934e089/system.windows.forms.dll
----------------------------------------
System
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase: file:///c:/windows/assembly/gac/system/1.0.5000.0__b77a5c561934e089/system.dll
----------------------------------------
System.Drawing
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase: file:///c:/windows/assembly/gac/system.drawing/1.0.5000.0__b03f5f7f11d50a3a/system.drawing.dll
----------------------------------------
Microsoft.VisualBasic
Assembly Version: 7.0.5000.0
Win32 Version: 7.10.3052.4
CodeBase: file:///c:/windows/assembly/gac/microsoft.visualbasic/7.0.5000.0__b03f5f7f11d50a3a/microsoft.visualbasic.dll
----------------------------------------
Microsoft.DirectX.DirectInput
Assembly Version: 1.0.2902.0
Win32 Version: 5.04.00.2904
CodeBase: file:///c:/windows/assembly/gac/microsoft.directx.directinput/1.0.2902.0__31bf3856ad364e35/microsoft.directx.directinput.dll
----------------------------------------
************** JIT Debugging **************
To enable just in time (JIT) debugging, the config file for this
application or machine (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.
For example:
<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>
When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the machine
rather than being handled by this dialog.
All of the Directinput.Key integers are ridiculously long, and short of coding a conversion of one letter to the ridiculous integer by hand, is there a shorter way of doing this, like a built-in converter in DirectX or an application that can do this for me?
EDIT: I'm a TOTAL DirectX newbie, and I just need to tap into directX enough to set up the detection of keypresses so I can take a screenshot immediately after the input is sent. I'm just having so many issues with this!