OSDN Git Service

DTXMania089リリースに際してのtag付け。
[dtxmania/dtxmania.git] / 110401(DTXMania089) / DTXManiaプロジェクト / コード / ステージ / 04.コンフィグ / CActConfigKeyAssign.cs
1 using System;\r
2 using System.Collections.Generic;\r
3 using System.Text;\r
4 using System.Runtime.InteropServices;\r
5 using System.Drawing;\r
6 using FDK;\r
7 \r
8 namespace DTXMania\r
9 {\r
10         internal class CActConfigKeyAssign : CActivity\r
11         {\r
12                 // プロパティ\r
13 \r
14                 public bool bキー入力待ちの最中である\r
15                 {\r
16                         get\r
17                         {\r
18                                 return this.bキー入力待ち;\r
19                         }\r
20                 }\r
21 \r
22 \r
23                 // メソッド\r
24 \r
25                 public void t開始( E楽器パート part, Eパッド pad, string strパッド名 )\r
26                 {\r
27                         if( part != E楽器パート.UNKNOWN )\r
28                         {\r
29                                 this.part = part;\r
30                                 this.pad = pad;\r
31                                 this.strパッド名 = strパッド名;\r
32                                 for( int i = 0; i < 0x10; i++ )\r
33                                 {\r
34                                         this.structReset用KeyAssign[ i ].入力デバイス = CDTXMania.ConfigIni.KeyAssign[ (int) part ][ (int) pad ][ i ].入力デバイス;\r
35                                         this.structReset用KeyAssign[ i ].ID = CDTXMania.ConfigIni.KeyAssign[ (int) part ][ (int) pad ][ i ].ID;\r
36                                         this.structReset用KeyAssign[ i ].コード = CDTXMania.ConfigIni.KeyAssign[ (int) part ][ (int) pad ][ i ].コード;\r
37                                 }\r
38                         }\r
39                 }\r
40                 public void tEnter押下()\r
41                 {\r
42                         if( !this.bキー入力待ち )\r
43                         {\r
44                                 CDTXMania.Skin.sound決定音.t再生する();\r
45                                 switch( this.n現在の選択行 )\r
46                                 {\r
47                                         case 0x10:\r
48                                                 for( int i = 0; i < 0x10; i++ )\r
49                                                 {\r
50                                                         CDTXMania.ConfigIni.KeyAssign[ (int) this.part ][ (int) this.pad ][ i ].入力デバイス = this.structReset用KeyAssign[ i ].入力デバイス;\r
51                                                         CDTXMania.ConfigIni.KeyAssign[ (int) this.part ][ (int) this.pad ][ i ].ID = this.structReset用KeyAssign[ i ].ID;\r
52                                                         CDTXMania.ConfigIni.KeyAssign[ (int) this.part ][ (int) this.pad ][ i ].コード = this.structReset用KeyAssign[ i ].コード;\r
53                                                 }\r
54                                                 return;\r
55 \r
56                                         case 0x11:\r
57                                                 CDTXMania.stageコンフィグ.tアサイン完了通知();\r
58                                                 return;\r
59                                 }\r
60                                 this.bキー入力待ち = true;\r
61                         }\r
62                 }\r
63                 public void t次に移動()\r
64                 {\r
65                         if( !this.bキー入力待ち )\r
66                         {\r
67                                 CDTXMania.Skin.soundカーソル移動音.t再生する();\r
68                                 this.n現在の選択行 = ( this.n現在の選択行 + 1 ) % 0x12;\r
69                         }\r
70                 }\r
71                 public void t前に移動()\r
72                 {\r
73                         if( !this.bキー入力待ち )\r
74                         {\r
75                                 CDTXMania.Skin.soundカーソル移動音.t再生する();\r
76                                 this.n現在の選択行 = ( ( this.n現在の選択行 - 1 ) + 0x12 ) % 0x12;\r
77                         }\r
78                 }\r
79 \r
80                 \r
81                 // CActivity 実装\r
82 \r
83                 public override void On活性化()\r
84                 {\r
85                         this.part = E楽器パート.UNKNOWN;\r
86                         this.pad = Eパッド.UNKNOWN;\r
87                         this.strパッド名 = "";\r
88                         this.n現在の選択行 = 0;\r
89                         this.bキー入力待ち = false;\r
90                         this.structReset用KeyAssign = new CConfigIni.CKeyAssign.STKEYASSIGN[ 0x10 ];\r
91                         base.On活性化();\r
92                 }\r
93                 public override void On非活性化()\r
94                 {\r
95                         if( !base.b活性化してない )\r
96                         {\r
97                                 CDTXMania.tテクスチャの解放( ref this.txカーソル );\r
98                                 CDTXMania.tテクスチャの解放( ref this.txHitKeyダイアログ );\r
99                                 base.On非活性化();\r
100                         }\r
101                 }\r
102                 public override void OnManagedリソースの作成()\r
103                 {\r
104                         if( !base.b活性化してない )\r
105                         {\r
106                                 this.txカーソル = CDTXMania.tテクスチャの生成( CSkin.Path( @"Graphics\ScreenConfig menu cursor.png" ), false );\r
107                                 this.txHitKeyダイアログ = CDTXMania.tテクスチャの生成( CSkin.Path( @"Graphics\ScreenConfig hit key to assign dialog.png" ), false );\r
108                                 base.OnManagedリソースの作成();\r
109                         }\r
110                 }\r
111                 public override int On進行描画()\r
112                 {\r
113                         if( !base.b活性化してない )\r
114                         {\r
115                                 if( this.bキー入力待ち )\r
116                                 {\r
117                                         if( CDTXMania.Input管理.Keyboard.bキーが押された( (int)SlimDX.DirectInput.Key.Escape ) )\r
118                                         {\r
119                                                 CDTXMania.Skin.sound取消音.t再生する();\r
120                                                 this.bキー入力待ち = false;\r
121                                                 CDTXMania.Input管理.tポーリング( CDTXMania.app.bApplicationActive, false );\r
122                                         }\r
123                                         else if( ( this.tキーチェックとアサイン・Keyboard() || this.tキーチェックとアサイン・MidiIn() ) || ( this.tキーチェックとアサイン・Joypad() || this.tキーチェックとアサイン・Mouse() ) )\r
124                                         {\r
125                                                 this.bキー入力待ち = false;\r
126                                                 CDTXMania.Input管理.tポーリング( CDTXMania.app.bApplicationActive, false );\r
127                                         }\r
128                                 }\r
129                                 else if( ( CDTXMania.Input管理.Keyboard.bキーが押された( (int)SlimDX.DirectInput.Key.Delete ) && ( this.n現在の選択行 >= 0 ) ) && ( this.n現在の選択行 <= 15 ) )\r
130                                 {\r
131                                         CDTXMania.Skin.sound決定音.t再生する();\r
132                                         CDTXMania.ConfigIni.KeyAssign[ (int) this.part ][ (int) this.pad ][ this.n現在の選択行 ].入力デバイス = E入力デバイス.不明;\r
133                                         CDTXMania.ConfigIni.KeyAssign[ (int) this.part ][ (int) this.pad ][ this.n現在の選択行 ].ID = 0;\r
134                                         CDTXMania.ConfigIni.KeyAssign[ (int) this.part ][ (int) this.pad ][ this.n現在の選択行 ].コード = 0;\r
135                                 }\r
136                                 if( this.txカーソル != null )\r
137                                 {\r
138                                         int num = 20;\r
139                                         int num2 = 0x144;\r
140                                         int num3 = 0x3e + ( num * ( this.n現在の選択行 + 1 ) );\r
141                                         this.txカーソル.t2D描画( CDTXMania.app.Device, num2, num3, new Rectangle( 0, 0, 0x10, 0x20 ) );\r
142                                         num2 += 0x10;\r
143                                         Rectangle rectangle = new Rectangle( 8, 0, 0x10, 0x20 );\r
144                                         for( int j = 0; j < 14; j++ )\r
145                                         {\r
146                                                 this.txカーソル.t2D描画( CDTXMania.app.Device, num2, num3, rectangle );\r
147                                                 num2 += 0x10;\r
148                                         }\r
149                                         this.txカーソル.t2D描画( CDTXMania.app.Device, num2, num3, new Rectangle( 0x10, 0, 0x10, 0x20 ) );\r
150                                 }\r
151                                 int num5 = 20;\r
152                                 int x = 0x134;\r
153                                 int y = 0x40;\r
154                                 CDTXMania.stageコンフィグ.actFont.t文字列描画( x, y, this.strパッド名, false, 0.75f );\r
155                                 y += num5;\r
156                                 CConfigIni.CKeyAssign.STKEYASSIGN[] stkeyassignArray = CDTXMania.ConfigIni.KeyAssign[ (int) this.part ][ (int) this.pad ];\r
157                                 for( int i = 0; i < 0x10; i++ )\r
158                                 {\r
159                                         switch( stkeyassignArray[ i ].入力デバイス )\r
160                                         {\r
161                                                 case E入力デバイス.キーボード:\r
162                                                         this.tアサインコードの描画・Keyboard( i + 1, x + 20, y, stkeyassignArray[ i ].ID, stkeyassignArray[ i ].コード, this.n現在の選択行 == i );\r
163                                                         break;\r
164 \r
165                                                 case E入力デバイス.MIDI入力:\r
166                                                         this.tアサインコードの描画・MidiIn( i + 1, x + 20, y, stkeyassignArray[ i ].ID, stkeyassignArray[ i ].コード, this.n現在の選択行 == i );\r
167                                                         break;\r
168 \r
169                                                 case E入力デバイス.ジョイパッド:\r
170                                                         this.tアサインコードの描画・Joypad( i + 1, x + 20, y, stkeyassignArray[ i ].ID, stkeyassignArray[ i ].コード, this.n現在の選択行 == i );\r
171                                                         break;\r
172 \r
173                                                 case E入力デバイス.マウス:\r
174                                                         this.tアサインコードの描画・Mouse( i + 1, x + 20, y, stkeyassignArray[ i ].ID, stkeyassignArray[ i ].コード, this.n現在の選択行 == i );\r
175                                                         break;\r
176 \r
177                                                 default:\r
178                                                         CDTXMania.stageコンフィグ.actFont.t文字列描画( x + 20, y, string.Format( "{0,2}.", i + 1 ), this.n現在の選択行 == i, 0.75f );\r
179                                                         break;\r
180                                         }\r
181                                         y += num5;\r
182                                 }\r
183                                 CDTXMania.stageコンフィグ.actFont.t文字列描画( x + 20, y, "Reset", this.n現在の選択行 == 0x10, 0.75f );\r
184                                 y += num5;\r
185                                 CDTXMania.stageコンフィグ.actFont.t文字列描画( x + 20, y, "<< Returnto List", this.n現在の選択行 == 0x11, 0.75f );\r
186                                 y += num5;\r
187                                 if( this.bキー入力待ち && ( this.txHitKeyダイアログ != null ) )\r
188                                 {\r
189                                         this.txHitKeyダイアログ.t2D描画( CDTXMania.app.Device, 0x185, 0xd7 );\r
190                                 }\r
191                         }\r
192                         return 0;\r
193                 }\r
194 \r
195 \r
196                 // その他\r
197 \r
198                 #region [ private ]\r
199                 //-----------------\r
200                 [StructLayout( LayoutKind.Sequential )]\r
201                 private struct STKEYLABEL\r
202                 {\r
203                         public int nCode;\r
204                         public string strLabel;\r
205                         public STKEYLABEL( int nCode, string strLabel )\r
206                         {\r
207                                 this.nCode = nCode;\r
208                                 this.strLabel = strLabel;\r
209                         }\r
210                 }\r
211 \r
212                 private bool bキー入力待ち;\r
213                 private STKEYLABEL[] KeyLabel = new STKEYLABEL[] { \r
214                         new STKEYLABEL(0x35, "[ESC]"), new STKEYLABEL(1, "[ 1 ]"), new STKEYLABEL(2, "[ 2 ]"), new STKEYLABEL(3, "[ 3 ]"), new STKEYLABEL(4, "[ 4 ]"), new STKEYLABEL(5, "[ 5 ]"), new STKEYLABEL(6, "[ 6 ]"), new STKEYLABEL(7, "[ 7 ]"), new STKEYLABEL(8, "[ 8 ]"), new STKEYLABEL(9, "[ 9 ]"), new STKEYLABEL(0, "[ 0 ]"), new STKEYLABEL(0x53, "[ - ]"), new STKEYLABEL(0x34, "[ = ]"), new STKEYLABEL(0x2a, "[BSC]"), new STKEYLABEL(0x81, "[TAB]"), new STKEYLABEL(0x1a, "[ Q ]"), \r
215                         new STKEYLABEL(0x20, "[ W ]"), new STKEYLABEL(14, "[ E ]"), new STKEYLABEL(0x1b, "[ R ]"), new STKEYLABEL(0x1d, "[ T ]"), new STKEYLABEL(0x22, "[ Y ]"), new STKEYLABEL(30, "[ U ]"), new STKEYLABEL(0x12, "[ I ]"), new STKEYLABEL(0x18, "[ O ]"), new STKEYLABEL(0x19, "[ P ]"), new STKEYLABEL(0x4a, "[ [ ]"), new STKEYLABEL(0x73, "[ ] ]"), new STKEYLABEL(0x75, "[Enter]"), new STKEYLABEL(0x4b, "[L-Ctrl]"), new STKEYLABEL(10, "[ A ]"), new STKEYLABEL(0x1c, "[ S ]"), new STKEYLABEL(13, "[ D ]"), \r
216                         new STKEYLABEL(15, "[ F ]"), new STKEYLABEL(0x10, "[ G ]"), new STKEYLABEL(0x11, "[ H ]"), new STKEYLABEL(0x13, "[ J ]"), new STKEYLABEL(20, "[ K ]"), new STKEYLABEL(0x15, "[ L ]"), new STKEYLABEL(0x7b, "[ ; ]"), new STKEYLABEL(0x26, "[ ' ]"), new STKEYLABEL(0x45, "[ ` ]"), new STKEYLABEL(0x4e, "[L-Shift]"), new STKEYLABEL(0x2b, @"[ \]"), new STKEYLABEL(0x23, "[ Z ]"), new STKEYLABEL(0x21, "[ X ]"), new STKEYLABEL(12, "[ C ]"), new STKEYLABEL(0x1f, "[ V ]"), new STKEYLABEL(11, "[ B ]"), \r
217                         new STKEYLABEL(0x17, "[ N ]"), new STKEYLABEL(0x16, "[ M ]"), new STKEYLABEL(0x2f, "[ , ]"), new STKEYLABEL(0x6f, "[ . ]"), new STKEYLABEL(0x7c, "[ / ]"), new STKEYLABEL(120, "[R-Shift]"), new STKEYLABEL(0x6a, "[ * ]"), new STKEYLABEL(0x4d, "[L-Alt]"), new STKEYLABEL(0x7e, "[Space]"), new STKEYLABEL(0x2d, "[CAPS]"), new STKEYLABEL(0x36, "[F1]"), new STKEYLABEL(0x37, "[F2]"), new STKEYLABEL(0x38, "[F3]"), new STKEYLABEL(0x39, "[F4]"), new STKEYLABEL(0x3a, "[F5]"), new STKEYLABEL(0x3b, "[F6]"), \r
218                         new STKEYLABEL(60, "[F7]"), new STKEYLABEL(0x3d, "[F8]"), new STKEYLABEL(0x3e, "[F9]"), new STKEYLABEL(0x3f, "[F10]"), new STKEYLABEL(0x58, "[NumLock]"), new STKEYLABEL(0x7a, "[Scroll]"), new STKEYLABEL(0x60, "[NPad7]"), new STKEYLABEL(0x61, "[NPad8]"), new STKEYLABEL(0x62, "[NPad9]"), new STKEYLABEL(0x66, "[NPad-]"), new STKEYLABEL(0x5d, "[NPad4]"), new STKEYLABEL(0x5e, "[NPad5]"), new STKEYLABEL(0x5f, "[NPad6]"), new STKEYLABEL(0x68, "[NPad+]"), new STKEYLABEL(90, "[NPad1]"), new STKEYLABEL(0x5b, "[NPad2]"), \r
219                         new STKEYLABEL(0x5c, "[NPad3]"), new STKEYLABEL(0x59, "[NPad0]"), new STKEYLABEL(0x67, "[NPad.]"), new STKEYLABEL(0x40, "[F11]"), new STKEYLABEL(0x41, "[F12]"), new STKEYLABEL(0x42, "[F13]"), new STKEYLABEL(0x43, "[F14]"), new STKEYLABEL(0x44, "[F15]"), new STKEYLABEL(0x48, "[Kana]"), new STKEYLABEL(0x24, "[ ? ]"), new STKEYLABEL(0x30, "[Henkan]"), new STKEYLABEL(0x57, "[MuHenkan]"), new STKEYLABEL(0x8f, @"[ \ ]"), new STKEYLABEL(0x25, "[NPad.]"), new STKEYLABEL(0x65, "[NPad=]"), new STKEYLABEL(0x72, "[ ^ ]"), \r
220                         new STKEYLABEL(40, "[ @ ]"), new STKEYLABEL(0x2e, "[ : ]"), new STKEYLABEL(130, "[ _ ]"), new STKEYLABEL(0x49, "[Kanji]"), new STKEYLABEL(0x7f, "[Stop]"), new STKEYLABEL(0x29, "[AX]"), new STKEYLABEL(100, "[NPEnter]"), new STKEYLABEL(0x74, "[R-Ctrl]"), new STKEYLABEL(0x54, "[Mute]"), new STKEYLABEL(0x2c, "[Calc]"), new STKEYLABEL(0x70, "[PlayPause]"), new STKEYLABEL(0x52, "[MediaStop]"), new STKEYLABEL(0x85, "[Volume-]"), new STKEYLABEL(0x86, "[Volume+]"), new STKEYLABEL(0x8b, "[WebHome]"), new STKEYLABEL(0x63, "[NPad,]"), \r
221                         new STKEYLABEL(0x69, "[ / ]"), new STKEYLABEL(0x80, "[PrtScn]"), new STKEYLABEL(0x77, "[R-Alt]"), new STKEYLABEL(110, "[Pause]"), new STKEYLABEL(70, "[Home]"), new STKEYLABEL(0x84, "[Up]"), new STKEYLABEL(0x6d, "[PageUp]"), new STKEYLABEL(0x4c, "[Left]"), new STKEYLABEL(0x76, "[Right]"), new STKEYLABEL(0x33, "[End]"), new STKEYLABEL(50, "[Down]"), new STKEYLABEL(0x6c, "[PageDown]"), new STKEYLABEL(0x47, "[Insert]"), new STKEYLABEL(0x31, "[Delete]"), new STKEYLABEL(0x4f, "[L-Win]"), new STKEYLABEL(0x79, "[R-Win]"), \r
222                         new STKEYLABEL(0x27, "[APP]"), new STKEYLABEL(0x71, "[Power]"), new STKEYLABEL(0x7d, "[Sleep]"), new STKEYLABEL(0x87, "[Wake]")\r
223                 };\r
224                 private int n現在の選択行;\r
225                 private Eパッド pad;\r
226                 private E楽器パート part;\r
227                 private CConfigIni.CKeyAssign.STKEYASSIGN[] structReset用KeyAssign;\r
228                 private string strパッド名;\r
229                 private CTexture txHitKeyダイアログ;\r
230                 private CTexture txカーソル;\r
231 \r
232                 private void tアサインコードの描画・Joypad( int line, int x, int y, int nID, int nCode, bool b強調 )\r
233                 {\r
234                         string str = "";\r
235                         switch( nCode )\r
236                         {\r
237                                 case 0:\r
238                                         str = "Left";\r
239                                         break;\r
240 \r
241                                 case 1:\r
242                                         str = "Right";\r
243                                         break;\r
244 \r
245                                 case 2:\r
246                                         str = "Up";\r
247                                         break;\r
248 \r
249                                 case 3:\r
250                                         str = "Down";\r
251                                         break;\r
252 \r
253                                 case 4:\r
254                                         str = "Forward";\r
255                                         break;\r
256 \r
257                                 case 5:\r
258                                         str = "Back";\r
259                                         break;\r
260 \r
261                                 default:\r
262                                         if( ( 6 <= nCode ) && ( nCode < 6 + 128 ) )                             // other buttons (128 types)\r
263                                         {\r
264                                                 str = string.Format( "Button{0}", nCode - 5 );\r
265                                         }\r
266                                         else if ( ( 6 + 128 <= nCode ) && ( nCode < 6 + 128 + 8 ) )             // POV HAT ( 8 types; 45 degrees per HATs)\r
267                                         {\r
268                                                 str = string.Format( "POV {0}", ( nCode - 6 - 128 ) * 45 );\r
269                                         }\r
270                                         else\r
271                                         {\r
272                                                 str = string.Format( "Code{0}", nCode );\r
273                                         }\r
274                                         break;\r
275                         }\r
276                         CDTXMania.stageコンフィグ.actFont.t文字列描画( x, y, string.Format( "{0,2}. Joypad #{1} ", line, nID ) + str, b強調, 0.75f );\r
277                 }\r
278                 private void tアサインコードの描画・Keyboard( int line, int x, int y, int nID, int nCode, bool b強調 )\r
279                 {\r
280                         string str = null;\r
281                         foreach( STKEYLABEL stkeylabel in this.KeyLabel )\r
282                         {\r
283                                 if( stkeylabel.nCode == nCode )\r
284                                 {\r
285                                         str = string.Format( "{0,2}. Key {1}", line, stkeylabel.strLabel );\r
286                                         break;\r
287                                 }\r
288                         }\r
289                         if( str == null )\r
290                         {\r
291                                 str = string.Format( "{0,2}. Key 0x{1:X2}", line, nCode );\r
292                         }\r
293                         CDTXMania.stageコンフィグ.actFont.t文字列描画( x, y, str, b強調, 0.75f );\r
294                 }\r
295                 private void tアサインコードの描画・MidiIn( int line, int x, int y, int nID, int nCode, bool b強調 )\r
296                 {\r
297                         CDTXMania.stageコンフィグ.actFont.t文字列描画( x, y, string.Format( "{0,2}. MidiIn #{1} code.{2}", line, nID, nCode ), b強調, 0.75f );\r
298                 }\r
299                 private void tアサインコードの描画・Mouse( int line, int x, int y, int nID, int nCode, bool b強調 )\r
300                 {\r
301                         CDTXMania.stageコンフィグ.actFont.t文字列描画( x, y, string.Format( "{0,2}. Mouse Button{1}", line, nCode ), b強調, 0.75f );\r
302                 }\r
303                 private bool tキーチェックとアサイン・Joypad()\r
304                 {\r
305                         foreach( IInputDevice device in CDTXMania.Input管理.list入力デバイス )\r
306                         {\r
307                                 if( device.e入力デバイス種別 == E入力デバイス種別.Joystick )\r
308                                 {\r
309                                         for( int i = 0; i < 0x80; i++ )\r
310                                         {\r
311                                                 if( device.bキーが押された( 6 + i ) )\r
312                                                 {\r
313                                                         CDTXMania.Skin.sound決定音.t再生する();\r
314                                                         CDTXMania.ConfigIni.t指定した入力が既にアサイン済みである場合はそれを全削除する( E入力デバイス.ジョイパッド, device.ID, 6 + i );\r
315                                                         CDTXMania.ConfigIni.KeyAssign[ (int) this.part ][ (int) this.pad ][ this.n現在の選択行 ].入力デバイス = E入力デバイス.ジョイパッド;\r
316                                                         CDTXMania.ConfigIni.KeyAssign[ (int) this.part ][ (int) this.pad ][ this.n現在の選択行 ].ID = device.ID;\r
317                                                         CDTXMania.ConfigIni.KeyAssign[ (int) this.part ][ (int) this.pad ][ this.n現在の選択行 ].コード = 6 + i;\r
318                                                         return true;\r
319                                                 }\r
320                                         }\r
321                                         for( int i = 0; i < 6; i++ )\r
322                                         {\r
323                                                 if( device.bキーが押された( i ) )\r
324                                                 {\r
325                                                         CDTXMania.Skin.sound決定音.t再生する();\r
326                                                         CDTXMania.ConfigIni.t指定した入力が既にアサイン済みである場合はそれを全削除する( E入力デバイス.ジョイパッド, device.ID, i );\r
327                                                         CDTXMania.ConfigIni.KeyAssign[ (int) this.part ][ (int) this.pad ][ this.n現在の選択行 ].入力デバイス = E入力デバイス.ジョイパッド;\r
328                                                         CDTXMania.ConfigIni.KeyAssign[ (int) this.part ][ (int) this.pad ][ this.n現在の選択行 ].ID = device.ID;\r
329                                                         CDTXMania.ConfigIni.KeyAssign[ (int) this.part ][ (int) this.pad ][ this.n現在の選択行 ].コード = i;\r
330                                                         return true;\r
331                                                 }\r
332                                         }\r
333                                         for ( int i = 6 + 0x80; i < 6 + 0x80 + 8; i++ )         // #24341 2011.3.10 yyagi; to supoprt HAT switch\r
334                                         {\r
335                                                 if ( device.bキーが押された( i ) )\r
336                                                 {\r
337                                                         CDTXMania.Skin.sound決定音.t再生する();\r
338                                                         CDTXMania.ConfigIni.t指定した入力が既にアサイン済みである場合はそれを全削除する( E入力デバイス.ジョイパッド, device.ID, 6 );\r
339                                                         CDTXMania.ConfigIni.KeyAssign[ (int) this.part ][ (int) this.pad ][ this.n現在の選択行 ].入力デバイス = E入力デバイス.ジョイパッド;\r
340                                                         CDTXMania.ConfigIni.KeyAssign[ (int) this.part ][ (int) this.pad ][ this.n現在の選択行 ].ID = device.ID;\r
341                                                         CDTXMania.ConfigIni.KeyAssign[ (int) this.part ][ (int) this.pad ][ this.n現在の選択行 ].コード = i;\r
342                                                         return true;\r
343                                                 }\r
344                                         }\r
345                                 }\r
346                         }\r
347                         return false;\r
348                 }\r
349                 private bool tキーチェックとアサイン・Keyboard()\r
350                 {\r
351                         for( int i = 0; i < 0x100; i++ )\r
352                         {\r
353                                 if( i != (int)SlimDX.DirectInput.Key.Escape &&\r
354                                         i != (int)SlimDX.DirectInput.Key.UpArrow &&\r
355                                         i != (int)SlimDX.DirectInput.Key.DownArrow &&\r
356                                         i != (int)SlimDX.DirectInput.Key.LeftArrow &&\r
357                                         i != (int)SlimDX.DirectInput.Key.RightArrow &&\r
358                                         i != (int)SlimDX.DirectInput.Key.Delete &&\r
359                                          CDTXMania.Input管理.Keyboard.bキーが押された( i ) )\r
360                                 {\r
361                                         CDTXMania.Skin.sound決定音.t再生する();\r
362                                         CDTXMania.ConfigIni.t指定した入力が既にアサイン済みである場合はそれを全削除する( E入力デバイス.キーボード, 0, i );\r
363                                         CDTXMania.ConfigIni.KeyAssign[ (int) this.part ][ (int) this.pad ][ this.n現在の選択行 ].入力デバイス = E入力デバイス.キーボード;\r
364                                         CDTXMania.ConfigIni.KeyAssign[ (int) this.part ][ (int) this.pad ][ this.n現在の選択行 ].ID = 0;\r
365                                         CDTXMania.ConfigIni.KeyAssign[ (int) this.part ][ (int) this.pad ][ this.n現在の選択行 ].コード = i;\r
366                                         return true;\r
367                                 }\r
368                         }\r
369                         return false;\r
370                 }\r
371                 private bool tキーチェックとアサイン・MidiIn()\r
372                 {\r
373                         foreach( IInputDevice device in CDTXMania.Input管理.list入力デバイス )\r
374                         {\r
375                                 if( device.e入力デバイス種別 == E入力デバイス種別.MidiIn )\r
376                                 {\r
377                                         for( int i = 0; i < 0x100; i++ )\r
378                                         {\r
379                                                 if( device.bキーが押された( i ) )\r
380                                                 {\r
381                                                         CDTXMania.Skin.sound決定音.t再生する();\r
382                                                         CDTXMania.ConfigIni.t指定した入力が既にアサイン済みである場合はそれを全削除する( E入力デバイス.MIDI入力, device.ID, i );\r
383                                                         CDTXMania.ConfigIni.KeyAssign[ (int) this.part ][ (int) this.pad ][ this.n現在の選択行 ].入力デバイス = E入力デバイス.MIDI入力;\r
384                                                         CDTXMania.ConfigIni.KeyAssign[ (int) this.part ][ (int) this.pad ][ this.n現在の選択行 ].ID = device.ID;\r
385                                                         CDTXMania.ConfigIni.KeyAssign[ (int) this.part ][ (int) this.pad ][ this.n現在の選択行 ].コード = i;\r
386                                                         return true;\r
387                                                 }\r
388                                         }\r
389                                 }\r
390                         }\r
391                         return false;\r
392                 }\r
393                 private bool tキーチェックとアサイン・Mouse()\r
394                 {\r
395                         for( int i = 0; i < 8; i++ )\r
396                         {\r
397                                 if( CDTXMania.Input管理.Mouse.bキーが押された( i ) )\r
398                                 {\r
399                                         CDTXMania.ConfigIni.t指定した入力が既にアサイン済みである場合はそれを全削除する( E入力デバイス.マウス, 0, i );\r
400                                         CDTXMania.ConfigIni.KeyAssign[ (int) this.part ][ (int) this.pad ][ this.n現在の選択行 ].入力デバイス = E入力デバイス.マウス;\r
401                                         CDTXMania.ConfigIni.KeyAssign[ (int) this.part ][ (int) this.pad ][ this.n現在の選択行 ].ID = 0;\r
402                                         CDTXMania.ConfigIni.KeyAssign[ (int) this.part ][ (int) this.pad ][ this.n現在の選択行 ].コード = i;\r
403                                 }\r
404                         }\r
405                         return false;\r
406                 }\r
407                 //-----------------\r
408                 #endregion\r
409         }\r
410 }\r