var captureCode = (SlimDX.DirectInput.Key) ConfigIni.KeyAssign[ EPad.Capture ][ i ].コード;\r
\r
if( (int) captureCode > 0 &&\r
- DeviceConstantConverter.KeyToKeys.ContainsKey( captureCode ) &&\r
- e.KeyCode == DeviceConstantConverter.KeyToKeys[ captureCode ] )\r
+ e.KeyCode == DeviceConstantConverter.KeyToKeys( captureCode ) )\r
{\r
// Debug.WriteLine( "capture: " + string.Format( "{0:2x}", (int) e.KeyCode ) + " " + (int) e.KeyCode );\r
string strFullPath =\r
using SharpDX;\r
using SharpDX.DirectInput;\r
\r
+using SlimDXKey = SlimDX.DirectInput.Key;\r
+using SharpDXKey = SharpDX.DirectInput.Key;\r
+\r
namespace FDK\r
{\r
public class CInputKeyboard : IInputDevice, IDisposable\r
{\r
this.devKeyboard = new Keyboard( directInput );\r
this.devKeyboard.SetCooperativeLevel( hWnd, CooperativeLevel.NoWinKey | CooperativeLevel.Foreground | CooperativeLevel.NonExclusive );\r
- this.devKeyboard.Properties.BufferSize = 0x20;\r
+ this.devKeyboard.Properties.BufferSize = 32;\r
Trace.TraceInformation( this.devKeyboard.Information.ProductName + " を生成しました。" );\r
}\r
catch\r
{\r
public class DeviceConstantConverter\r
{\r
+ /// <returns>\r
+ /// 対応する値がなければ SlimDX.DirectInput.Unknown を返す。\r
+ /// </returns>\r
+ public static SlimDXKey DIKtoKey( SharpDXKey key )\r
+ {\r
+ if( _DIKtoKey.ContainsKey( key ) )\r
+ {\r
+ return _DIKtoKey[ key ];\r
+ }\r
+ else\r
+ {\r
+ return SlimDXKey.Unknown;\r
+ }\r
+ }\r
+\r
+ /// <returns>\r
+ /// 対応する値がなければ System.Windows.Forms.Keys.None を返す。\r
+ /// </returns>\r
+ public static WindowsKey KeyToKeys( SlimDXKey key )\r
+ {\r
+ if( _KeyToKeys.ContainsKey( key ) )\r
+ {\r
+ return _KeyToKeys[ key ];\r
+ }\r
+ else\r
+ {\r
+ return WindowsKey.None;\r
+ }\r
+ }\r
+\r
+\r
/// <summary>\r
/// DIK (SharpDX.DirectInput.Key) から SlimDX.DirectInput.Key への変換表。\r
/// </summary>\r
- public static readonly Dictionary<SharpDXKey, SlimDXKey> DIKtoKey = new Dictionary<SharpDXKey, SlimDXKey>() {\r
+ private static readonly Dictionary<SharpDXKey, SlimDXKey> _DIKtoKey = new Dictionary<SharpDXKey, SlimDXKey>() {\r
#region [ *** ]\r
{ SharpDXKey.Unknown, SlimDXKey.Unknown },\r
{ SharpDXKey.Escape, SlimDXKey.Escape },\r
/// <summary>\r
/// SlimDX.DirectInput.Key から System.Windows.Form.Keys への変換表。\r
/// </summary>\r
- public static readonly Dictionary<SlimDXKey, WindowsKey> KeyToKeys = new Dictionary<SlimDXKey, WindowsKey>() {\r
+ private static readonly Dictionary<SlimDXKey, WindowsKey> _KeyToKeys = new Dictionary<SlimDXKey, WindowsKey>() {\r
#region [ *** ]\r
{ SlimDXKey.D0, WindowsKey.D0 },\r
{ SlimDXKey.D1, WindowsKey.D1 },\r