DXフレームワーク　リファレンス・マニュアル 0.01 DXフレームワークのリファレンスです。詳細は公式wiki

- メインページ
- 関連ページ
- クラス
- ファイル

- ファイル一覧

Input.h
1 #pragma once
2 #include <DxLib.h>
3 #include <Figure.h>
4 #include <string>
5 #include <list>
6
7 #define NULL_HANDLE -1
8
9 namespace DXFW
10 {
12 enum class PadType
13 {
14 KeyAndPad1 = DX_INPUT_KEY_PAD1,
15 Pad1 = DX_INPUT_PAD1,
16 Pad2 = DX_INPUT_PAD2,
17 Pad3 = DX_INPUT_PAD3,
18 Pad4 = DX_INPUT_PAD4,
19 KeyBord = DX_INPUT_KEY
20 };
21
23 enum class PadCode : LONG64
24 {
25 Down = PAD_INPUT_DOWN ,
26 Left = PAD_INPUT_LEFT,
27 Right = PAD_INPUT_RIGHT,
28 Up = PAD_INPUT_UP,
29 Button1 = PAD_INPUT_1,
30 Button2 = PAD_INPUT_2,
31 Button3 = PAD_INPUT_3,
32 Button4 = PAD_INPUT_4,
33 Button5 = PAD_INPUT_5,
34 Button6 = PAD_INPUT_6,
35 Button7 = PAD_INPUT_7,
36 Button8 = PAD_INPUT_8,
37 Button9 = PAD_INPUT_9,
38 Button10 = PAD_INPUT_10,
39 Button11 = PAD_INPUT_11,
40 Button12 = PAD_INPUT_12,
41 Button13 = PAD_INPUT_13,
42 Button14 = PAD_INPUT_14,
43 Button15 = PAD_INPUT_15,
44 Button16 = PAD_INPUT_16,
45 Button17 = PAD_INPUT_17,
46 Button18 = PAD_INPUT_18,
47 Button19 = PAD_INPUT_19,
48 Button20 = PAD_INPUT_20,
49 Button21 = PAD_INPUT_21,
50 Button22 = PAD_INPUT_22,
51 Button23 = PAD_INPUT_23,
52 Button24 = PAD_INPUT_24,
53 Button25 = PAD_INPUT_25,
54 Button26 = PAD_INPUT_26,
55 Button27 = PAD_INPUT_27,
56 Button28 = PAD_INPUT_28
57 };
58
60 enum class KeyCode
61 {
62 Null = -1,
63 Back = KEY_INPUT_BACK,
64 Tab = KEY_INPUT_TAB,
65 Return = KEY_INPUT_RETURN,
66 LShift = KEY_INPUT_LSHIFT,
67 RShift = KEY_INPUT_RSHIFT,
68 LControl = KEY_INPUT_LCONTROL,
69 RControl = KEY_INPUT_RCONTROL,
70 Escape = KEY_INPUT_ESCAPE,
71 Space = KEY_INPUT_SPACE,
72 PageUp = KEY_INPUT_PGUP,
73 PageDown = KEY_INPUT_PGDN,
74 End = KEY_INPUT_END,
75 Home = KEY_INPUT_HOME,
76 Left = KEY_INPUT_LEFT,
77 Up = KEY_INPUT_UP,
78 Right = KEY_INPUT_RIGHT,
79 Down = KEY_INPUT_DOWN,
80 Insert = KEY_INPUT_INSERT,
81 Delete = KEY_INPUT_DELETE,
82
83 Minus = KEY_INPUT_MINUS,
84 Yen = KEY_INPUT_YEN,
85 PrevTrack = KEY_INPUT_PREVTRACK,
86 Period = KEY_INPUT_PERIOD,
87 Slash = KEY_INPUT_SLASH,
88 LAlt = KEY_INPUT_LALT,
89 RAlt = KEY_INPUT_RALT,
90 Scroll = KEY_INPUT_SCROLL,
91 Semicolon = KEY_INPUT_SEMICOLON,
92 Colon = KEY_INPUT_COLON,
93 LBracket = KEY_INPUT_LBRACKET,
94 RBracket = KEY_INPUT_RBRACKET,
95 At = KEY_INPUT_AT,
96 Backslash = KEY_INPUT_BACKSLASH,
97 Comma = KEY_INPUT_COMMA,
98 Capslock = KEY_INPUT_CAPSLOCK,
99 Pause = KEY_INPUT_PAUSE,
100
101 Numpad0 = KEY_INPUT_NUMPAD0,
102 Numpad1 = KEY_INPUT_NUMPAD1,
103 Numpad2 = KEY_INPUT_NUMPAD2,
104 Numpad3 = KEY_INPUT_NUMPAD3,
105 Numpad4 = KEY_INPUT_NUMPAD4,
106 Numpad5 = KEY_INPUT_NUMPAD5,
107 Numpad6 = KEY_INPUT_NUMPAD6,
108 Numpad7 = KEY_INPUT_NUMPAD7,
109 Numpad8 = KEY_INPUT_NUMPAD8,
110 Numpad9 = KEY_INPUT_NUMPAD9,
111 Multiply = KEY_INPUT_MULTIPLY,
112 Add = KEY_INPUT_ADD,
113 Subtract = KEY_INPUT_SUBTRACT,
114 Decimal = KEY_INPUT_DECIMAL,
115 Divide = KEY_INPUT_DIVIDE,
116 NUMPADEnter = KEY_INPUT_NUMPADENTER,
117
118 F1 = KEY_INPUT_F1,
119 F2 = KEY_INPUT_F2,
120 F3 = KEY_INPUT_F3,
121 F4 = KEY_INPUT_F4,
122 F5 = KEY_INPUT_F5,
123 F6 = KEY_INPUT_F6,
124 F7 = KEY_INPUT_F7,
125 F8 = KEY_INPUT_F8,
126 F9 = KEY_INPUT_F9,
127 F10 = KEY_INPUT_F10,
128 F11 = KEY_INPUT_F11,
129 F12 = KEY_INPUT_F12,
130
131 A = KEY_INPUT_A,
132 B = KEY_INPUT_B,
133 C = KEY_INPUT_C,
134 D = KEY_INPUT_D,
135 E = KEY_INPUT_E,
136 F = KEY_INPUT_F,
137 G = KEY_INPUT_G,
138 H = KEY_INPUT_H,
139 I = KEY_INPUT_I,
140 J = KEY_INPUT_J,
141 K = KEY_INPUT_K,
142 L = KEY_INPUT_L,
143 M = KEY_INPUT_M,
144 N = KEY_INPUT_N,
145 O = KEY_INPUT_O,
146 P = KEY_INPUT_P,
147 Q = KEY_INPUT_Q,
148 R = KEY_INPUT_R,
149 S = KEY_INPUT_S,
150 T = KEY_INPUT_T,
151 U = KEY_INPUT_U,
152 V = KEY_INPUT_V,
153 W = KEY_INPUT_W,
154 X = KEY_INPUT_X,
155 Y = KEY_INPUT_Y,
156 Z = KEY_INPUT_Z,
157 _0 = KEY_INPUT_0,
158 _1 = KEY_INPUT_1,
159 _2 = KEY_INPUT_2,
160 _3 = KEY_INPUT_3,
161 _4 = KEY_INPUT_4,
162 _5 = KEY_INPUT_5,
163 _6 = KEY_INPUT_6,
164 _7 = KEY_INPUT_7,
165 _8 = KEY_INPUT_8,
166 _9 = KEY_INPUT_9
167 };
168
170 enum class MouseCode
171 {
172 Left = MOUSE_INPUT_LEFT,
173 Right = MOUSE_INPUT_RIGHT,
174 Middle = MOUSE_INPUT_MIDDLE,
175 _4 = MOUSE_INPUT_4,
176 _5 = MOUSE_INPUT_5,
177 _6 = MOUSE_INPUT_6,
178 _7 = MOUSE_INPUT_7,
179 _8 = MOUSE_INPUT_8
180 };
181
183 class Key
184 {
185 public:
186 bool on;//押した瞬間
187 bool off;//離した瞬間
188 bool hold;//押されている
189 unsigned int holdCount;//押されている時間
190
191 Key() :
192 on(false),
193 off(false),
194 hold(false),
195 holdCount(0)
196 {}
197
199 void Reset()
200 {
201 on = false;
202 off = false;
203 hold = false;
204 holdCount = 0;
205 }
206
208 void Update(int isHold)
209 {
210 if( !hold && isHold ) on = true;
211 else on = false;
212 if( hold && !isHold ) off = true;
213 else off = false;
214
215 if( isHold ){
216 hold = true;
217 holdCount++;
218 }else{
219 hold = false;
220 holdCount = 0;
221 }
222 }
223 };
224
226 class Joypad
227 {
228 private:
229 PadType inputType;
230 Joypad(const Joypad &joypad);
231 Joypad operator =(const Joypad &joypad);
232 public:
233 Joypad():
234 inputType(PadType::KeyAndPad1),
235 StickX(0),
236 StickY(0)
237 {};
238
239 ~Joypad(){};
240
241 Key Down;
242 Key Left;
243 Key Right;
244 Key Up;
245 Key Button1;
246 Key Button2;
247 Key Button3;
248 Key Button4;
249 Key Button5;
250 Key Button6;
251 Key Button7;
252 Key Button8;
253 Key Button9;
254 Key Button10;
255 Key Button11;
256 Key Button12;
257 Key Button13;
258 Key Button14;
259 Key Button15;
260 Key Button16;
261 Key Button17;
262 Key Button18;
263 Key Button19;
264 Key Button20;
265 Key Button21;
266 Key Button22;
267 Key Button23;
268 Key Button24;
269 Key Button25;
270 Key Button26;
271 Key Button27;
272 Key Button28;
273
274 int StickX;
275 int StickY;
276
278 void Make(PadType パッドタイプ)
279 {
280 inputType = パッドタイプ;
281 }
282
284 void Reset()
285 {
286 Up.Reset();
287 Down.Reset();
288 Left.Reset();
289 Right.Reset();
290 Button1.Reset();
291 Button2.Reset();
292 Button3.Reset();
293 Button4.Reset();
294 Button5.Reset();
295 Button6.Reset();
296 Button7.Reset();
297 Button8.Reset();
298 Button9.Reset();
299 Button10.Reset();
300 Button11.Reset();
301 Button12.Reset();
302 Button13.Reset();
303 Button14.Reset();
304 Button15.Reset();
305 Button16.Reset();
306 Button17.Reset();
307 Button18.Reset();
308 Button19.Reset();
309 Button20.Reset();
310 Button21.Reset();
311 Button22.Reset();
312 Button23.Reset();
313 Button24.Reset();
314 Button25.Reset();
315 Button26.Reset();
316 Button27.Reset();
317 Button28.Reset();
318
319 StickX = 0;
320 StickY = 0;
321 }
322
324 bool Update()
325 {
326 const int N = DxLib::GetJoypadInputState( static_cast<int>(inputType)) ;
327 DxLib::GetJoypadAnalogInput( &StickX , &StickY, (int)inputType );
328 Down.Update( N & (int)PadCode::Down);
329 Left.Update( N & (int)PadCode::Left );
330 Right.Update( N & (int)PadCode::Right );
331 Up.Update( N & (int)PadCode::Up );
332 Button1.Update( N & (int)PadCode::Button1 );
333 Button2.Update( N & (int)PadCode::Button2 );
334 Button3.Update( N & (int)PadCode::Button3 );
335 Button4.Update( N & (int)PadCode::Button4 );
336 Button5.Update( N & (int)PadCode::Button5 );
337 Button6.Update( N & (int)PadCode::Button6 );
338 Button7.Update( N & (int)PadCode::Button7 );
339 Button8.Update( N & (int)PadCode::Button8 );
340 Button9.Update( N & (int)PadCode::Button9 );
341 Button10.Update( N & (int)PadCode::Button10 );
342 Button11.Update( N & (int)PadCode::Button11 );
343 Button12.Update( N & (int)PadCode::Button12 );
344 Button13.Update( N & (int)PadCode::Button13 );
345 Button14.Update( N & (int)PadCode::Button14 );
346 Button15.Update( N & (int)PadCode::Button15 );
347 Button16.Update( N & (int)PadCode::Button16 );
348 Button17.Update( N & (int)PadCode::Button17 );
349 Button18.Update( N & (int)PadCode::Button18 );
350 Button19.Update( N & (int)PadCode::Button19 );
351 Button20.Update( N & (int)PadCode::Button20 );
352 Button21.Update( N & (int)PadCode::Button21 );
353 Button22.Update( N & (int)PadCode::Button22 );
354 Button23.Update( N & (int)PadCode::Button23 );
355 Button24.Update( N & (int)PadCode::Button24 );
356 Button25.Update( N & (int)PadCode::Button25 );
357 Button26.Update( N & (int)PadCode::Button26 );
358 Button27.Update( N & (int)PadCode::Button27 );
359 Button28.Update( N & (LONG64)PadCode::Button28 );
360
361 return true;
362 }
363
365 PadType GetInputType()
366 {
367 return inputType;
368 }
369
371 void SetInputType(PadType inputPudType)
372 {
373 inputType = inputPudType;
374 }
375
378 bool SetInputToKey(PadCode padInput,KeyCode keyInput1 ,KeyCode keyInput2 = KeyCode::Null , KeyCode keyInput3 = KeyCode::Null,KeyCode keyInput4= KeyCode::Null)
379 {
380 return !DxLib::SetJoypadInputToKeyInput( (int)inputType , (int)padInput, (int)keyInput1, (int)keyInput2, (int)keyInput3, (int)keyInput4 ) ;
381 }
382
386 bool StartVibration(double power,int time)
387 {
388 return !DxLib::StartJoypadVibration( (int)inputType , int(power*1000), time ) ;
389 }
390
392 bool StopVibration()
393 {
394 return !DxLib::StopJoypadVibration( (int)inputType ) ;
395 }
396
398 static int GetCount()
399 {
400 return DxLib::GetJoypadNum();
401 }
402 };
403
405 class Mouse
406 {
407 private:
408 Mouse( const Mouse &mouse);
409 Mouse operator =( const Mouse &mouse);
410 public:
411 Mouse()
412 {
413 Reset();
414 }
415
416 int x;
417 int y;
418
419 int moveX;
420 int moveY;
421
422 int Whell;
423
424 Key Left;
425 Key Right;
426 Key Middle;
427
428 Key Button4;
429 Key Button5;
430 Key Button6;
431 Key Button7;
432 Key Button8;
433
434 int maxButton;
435
437 void Reset()
438 {
439 x = 0;
440 y = 0;
441 moveX = 0;
442 moveY = 0;
443 Left.Reset();
444 Right.Reset();
445 Middle.Reset();
446 Button4.Reset();
447 Button5.Reset();
448 Button6.Reset();
449 Button7.Reset();
450 Button8.Reset();
451 Whell = 0;
452 }
453
455 bool Update()
456 {
457 int X,Y;
458 DxLib::GetMousePoint(&X,&Y);
459 moveX = X - x;
460 moveY = Y - y;
461
462 x = X;
463 y = Y;
464
465 int N = DxLib::GetMouseInput();
466
467 Left.Update( N & (int)MouseCode::Left );
468 Right.Update( N & (int)MouseCode::Right );
469 Middle.Update( N & (int)MouseCode::Middle );
470
471 Button4.Update( N & (int)MouseCode::_4 );
472 Button5.Update( N & (int)MouseCode::_5 );
473 Button6.Update( N & (int)MouseCode::_6 );
474 Button7.Update( N & (int)MouseCode::_7 );
475 Button8.Update( N & (int)MouseCode::_8 );
476
477 return true;
478 }
479
481 bool SetVisible(bool 表示フラグ)
482 {
483 return !SetMouseDispFlag( 表示フラグ );
484 }
485
487 bool SetPoint( int x , int y )
488 {
489 return !SetMousePoint( x , y );
490 }
491
492 };
493
495 class Keyboard
496 {
497 private:
498 Keyboard(const Keyboard &key);
499 Keyboard& operator =(const Keyboard &key);
500 public:
501 Keyboard(){};
502
503 Key Back;
504 Key Tab;
505 Key Return;
506 Key LShift;
507 Key RShift;
508 Key LControl;
509 Key RControl;
510 Key Escape;
511 Key Space;
512 Key PageUp;
513 Key PageDown;
514 Key End;
515 Key Home;
516 Key Left;
517 Key Up;
518 Key Right;
519 Key Down;
520 Key Insert;
521 Key Delete;
522
523 Key Minus;
524 Key Yen;
525 Key PrevTrack;
526 Key Period;
527 Key Slash;
528 Key LAlt;
529 Key RAlt;
530 Key Scroll;
531 Key Semicolon;
532 Key Colon;
533 Key LBracket;
534 Key RBracket;
535 Key At;
536 Key Backslash;
537 Key Comma;
538 Key Capslock;
539 Key Pause;
540
541 Key Numpad0;
542 Key Numpad1;
543 Key Numpad2;
544 Key Numpad3;
545 Key Numpad4;
546 Key Numpad5;
547 Key Numpad6;
548 Key Numpad7;
549 Key Numpad8;
550 Key Numpad9;
551 Key Multiply;
552 Key Add;
553 Key Subtract;
554 Key Decimal;
555 Key Divide;
556 Key NUMPADEnter;
557
558 Key F1;
559 Key F2;
560 Key F3;
561 Key F4;
562 Key F5;
563 Key F6;
564 Key F7;
565 Key F8;
566 Key F9;
567 Key F10;
568 Key F11;
569 Key F12;
570
571 Key A;
572 Key B;
573 Key C;
574 Key D;
575 Key E;
576 Key F;
577 Key G;
578 Key H;
579 Key I;
580 Key J;
581 Key K;
582 Key L;
583 Key M;
584 Key N;
585 Key O;
586 Key P;
587 Key Q;
588 Key R;
589 Key S;
590 Key T;
591 Key U;
592 Key V;
593 Key W;
594 Key X;
595 Key Y;
596 Key Z;
597 Key _0;
598 Key _1;
599 Key _2;
600 Key _3;
601 Key _4;
602 Key _5;
603 Key _6;
604 Key _7;
605 Key _8;
606 Key _9;
607
609 void Reset()
610 {
611 Back.Reset();
612 Tab.Reset();
613 Return.Reset();
614 LShift.Reset();
615 RShift.Reset();
616 LControl.Reset();
617 RControl.Reset();
618 Escape.Reset();
619 Space.Reset();
620 PageUp.Reset();
621 PageDown.Reset();
622 End.Reset();
623 Home.Reset();
624 Left.Reset();
625 Up.Reset();
626 Right.Reset();
627 Down.Reset();
628 Insert.Reset();
629 Delete.Reset();
630
631 Minus.Reset();
632 Yen.Reset();
633 PrevTrack.Reset();
634 Period.Reset();
635 Slash.Reset();
636 LAlt.Reset();
637 RAlt.Reset();
638 Scroll.Reset();
639 Semicolon.Reset();
640 Colon.Reset();
641 LBracket.Reset();
642 RBracket.Reset();
643 At.Reset();
644 Backslash.Reset();
645 Comma.Reset();
646 Capslock.Reset();
647 Pause.Reset();
648
649 Numpad0.Reset();
650 Numpad1.Reset();
651 Numpad2.Reset();
652 Numpad3.Reset();
653 Numpad4.Reset();
654 Numpad5.Reset();
655 Numpad6.Reset();
656 Numpad7.Reset();
657 Numpad8.Reset();
658 Numpad9.Reset();
659 Multiply.Reset();
660 Add.Reset();
661 Subtract.Reset();
662 Decimal.Reset();
663 Divide.Reset();
664 NUMPADEnter.Reset();
665
666 F1.Reset();
667 F2.Reset();
668 F3.Reset();
669 F4.Reset();
670 F5.Reset();
671 F6.Reset();
672 F7.Reset();
673 F8.Reset();
674 F9.Reset();
675 F10.Reset();
676 F11.Reset();
677 F12.Reset();
678
679 A.Reset();
680 B.Reset();
681 C.Reset();
682 D.Reset();
683 E.Reset();
684 F.Reset();
685 G.Reset();
686 H.Reset();
687 I.Reset();
688 J.Reset();
689 K.Reset();
690 L.Reset();
691 M.Reset();
692 N.Reset();
693 O.Reset();
694 P.Reset();
695 Q.Reset();
696 R.Reset();
697 S.Reset();
698 T.Reset();
699 U.Reset();
700 V.Reset();
701 W.Reset();
702 X.Reset();
703 Y.Reset();
704 Z.Reset();
705 _0.Reset();
706 _1.Reset();
707 _2.Reset();
708 _3.Reset();
709 _4.Reset();
710 _5.Reset();
711 _6.Reset();
712 _7.Reset();
713 _8.Reset();
714 _9.Reset();
715 }
716
718 bool Update()
719 {
720 char Buf[ 256 ] ;
721 DxLib::GetHitKeyStateAll( Buf );
722
723 Back.Update( Buf[ (int)KeyCode::Back ] );
724 Tab.Update( Buf[ (int)KeyCode::Tab ] );
725 Return.Update( Buf[ (int)KeyCode::Return ] );
726 LShift.Update( Buf[ (int)KeyCode::LShift ] );
727 RShift.Update( Buf[ (int)KeyCode::RShift ] );
728 LControl.Update( Buf[ (int)KeyCode::LControl ] );
729 RControl.Update( Buf[ (int)KeyCode::RControl ] );
730 Escape.Update( Buf[ (int)KeyCode::Escape ] );
731 Space.Update( Buf[ (int)KeyCode::Space ] );
732 PageUp.Update( Buf[ (int)KeyCode::PageUp ] );
733 PageDown.Update( Buf[ (int)KeyCode::PageDown ] );
734 End.Update( Buf[ (int)KeyCode::End ] );
735 Home.Update( Buf[ (int)KeyCode::Home ] );
736 Left.Update( Buf[ (int)KeyCode::Left ] );
737 Up.Update( Buf[ (int)KeyCode::Up ] );
738 Right.Update( Buf[ (int)KeyCode::Right ] );
739 Down.Update( Buf[ (int)KeyCode::Down ] );
740 Insert.Update( Buf[ (int)KeyCode::Insert ] );
741 Delete.Update( Buf[ (int)KeyCode::Delete ] );
742
743 Minus.Update( Buf[ (int)KeyCode::Minus ] );
744 Yen.Update( Buf[ (int)KeyCode::Yen ] );
745 PrevTrack.Update( Buf[ (int)KeyCode::PrevTrack ] );
746 Period.Update( Buf[ (int)KeyCode::Period ] );
747 Slash.Update( Buf[ (int)KeyCode::Slash ] );
748 LAlt.Update( Buf[ (int)KeyCode::LAlt ] );
749 RAlt.Update( Buf[ (int)KeyCode::RAlt ] );
750 Scroll.Update( Buf[ (int)KeyCode::Scroll ] );
751 Semicolon.Update( Buf[ (int)KeyCode::Semicolon ] );
752 Colon.Update( Buf[ (int)KeyCode::Colon ] );
753 LBracket.Update( Buf[ (int)KeyCode::LBracket ] );
754 RBracket.Update( Buf[ (int)KeyCode::RBracket ] );
755 At.Update( Buf[ (int)KeyCode::At ] );
756 Backslash.Update( Buf[ (int)KeyCode::Backslash ] );
757 Comma.Update( Buf[ (int)KeyCode::Comma ] );
758 Capslock.Update( Buf[ (int)KeyCode::Capslock ] );
759 Pause.Update( Buf[ (int)KeyCode::Pause ] );
760
761 Numpad0.Update( Buf[ (int)KeyCode::Numpad0 ] );
762 Numpad1.Update( Buf[ (int)KeyCode::Numpad1 ] );
763 Numpad2.Update( Buf[ (int)KeyCode::Numpad2 ] );
764 Numpad3.Update( Buf[ (int)KeyCode::Numpad3 ] );
765 Numpad4.Update( Buf[ (int)KeyCode::Numpad4 ] );
766 Numpad5.Update( Buf[ (int)KeyCode::Numpad5 ] );
767 Numpad6.Update( Buf[ (int)KeyCode::Numpad6 ] );
768 Numpad7.Update( Buf[ (int)KeyCode::Numpad7 ] );
769 Numpad8.Update( Buf[ (int)KeyCode::Numpad8 ] );
770 Numpad9.Update( Buf[ (int)KeyCode::Numpad9 ] );
771 Multiply.Update( Buf[ (int)KeyCode::Multiply ] );
772 Add.Update( Buf[ (int)KeyCode::Add ] );
773 Subtract.Update( Buf[ (int)KeyCode::Subtract ] );
774 Decimal.Update( Buf[ (int)KeyCode::Decimal ] );
775 Divide.Update( Buf[ (int)KeyCode::Divide ] );
776 NUMPADEnter.Update( Buf[ (int)KeyCode::NUMPADEnter ] );
777
778 F1.Update( Buf[ (int)KeyCode::F1 ] );
779 F2.Update( Buf[ (int)KeyCode::F2 ] );
780 F3.Update( Buf[ (int)KeyCode::F3 ] );
781 F4.Update( Buf[ (int)KeyCode::F4 ] );
782 F5.Update( Buf[ (int)KeyCode::F5 ] );
783 F6.Update( Buf[ (int)KeyCode::F6 ] );
784 F7.Update( Buf[ (int)KeyCode::F7 ] );
785 F8.Update( Buf[ (int)KeyCode::F8 ] );
786 F9.Update( Buf[ (int)KeyCode::F9 ] );
787 F10.Update( Buf[ (int)KeyCode::F10 ] );
788 F11.Update( Buf[ (int)KeyCode::F11 ] );
789 F12.Update( Buf[ (int)KeyCode::F12 ] );
790
791 A.Update( Buf[ (int)KeyCode::A ] );
792 B.Update( Buf[ (int)KeyCode::B ] );
793 C.Update( Buf[ (int)KeyCode::C ] );
794 D.Update( Buf[ (int)KeyCode::D ] );
795 E.Update( Buf[ (int)KeyCode::E ] );
796 F.Update( Buf[ (int)KeyCode::F ] );
797 G.Update( Buf[ (int)KeyCode::G ] );
798 H.Update( Buf[ (int)KeyCode::H ] );
799 I.Update( Buf[ (int)KeyCode::I ] );
800 J.Update( Buf[ (int)KeyCode::J ] );
801 K.Update( Buf[ (int)KeyCode::K ] );
802 L.Update( Buf[ (int)KeyCode::L ] );
803 M.Update( Buf[ (int)KeyCode::M ] );
804 N.Update( Buf[ (int)KeyCode::N ] );
805 O.Update( Buf[ (int)KeyCode::O ] );
806 P.Update( Buf[ (int)KeyCode::P ] );
807 Q.Update( Buf[ (int)KeyCode::Q ] );
808 R.Update( Buf[ (int)KeyCode::R ] );
809 S.Update( Buf[ (int)KeyCode::S ] );
810 T.Update( Buf[ (int)KeyCode::T ] );
811 U.Update( Buf[ (int)KeyCode::U ] );
812 V.Update( Buf[ (int)KeyCode::V ] );
813 W.Update( Buf[ (int)KeyCode::W ] );
814 X.Update( Buf[ (int)KeyCode::X ] );
815 Y.Update( Buf[ (int)KeyCode::Y ] );
816 Z.Update( Buf[ (int)KeyCode::Z ] );
817 _0.Update( Buf[ (int)KeyCode::_0 ] );
818 _1.Update( Buf[ (int)KeyCode::_1 ] );
819 _2.Update( Buf[ (int)KeyCode::_2 ] );
820 _3.Update( Buf[ (int)KeyCode::_3 ] );
821 _4.Update( Buf[ (int)KeyCode::_4 ] );
822 _5.Update( Buf[ (int)KeyCode::_5 ] );
823 _6.Update( Buf[ (int)KeyCode::_6 ] );
824 _7.Update( Buf[ (int)KeyCode::_7 ] );
825 _8.Update( Buf[ (int)KeyCode::_8 ] );
826 _9.Update( Buf[ (int)KeyCode::_9 ] );
827
828 return true;
829 }
830
832 static bool HoldAnyKey()
833 {
834 return !DxLib::CheckHitKeyAll();
835 }
836
837 };
838
839
840 /*
844 class KeyBuffer
845 {
846 private:
847 KeyBuffer();
848 public:
850 static char GetInputChar(bool isDelete = true)
851 {
852 return DxLib::GetInputChar( isDelete );
853 }
854
856 static int GetInputCharWait(bool isDelete = true)
857 {
858 return DxLib::GetInputCharWait( isDelete);
859 }
860
862 static int ClearInputCharBuf( void )
863 {
864 return DxLib::ClearInputCharBuf();
865 }
866 };
867 */
868
870 class Input
871 {
872 private:
873 Input(){}
874 ~Input();
875
876 static int handle;
877
878 public:
879 static Joypad pad;
880 static Mouse mouse;
881 static Keyboard key;
882
884 static void Reset()
885 {
886 Input::pad.Reset();
887 Input::mouse.Reset();
888 Input::key.Reset();
889 }
890
892 static void Update()
893 {
894 Input::pad.Update();
895 Input::mouse.Update();
896 Input::key.Update();
897 }
898
903 static bool Text(int x,int y,int maxLength, char *str ,int isEscCancel ,bool isSingleOnly = false)
904 {
905 if( isSingleOnly )
906 {
907 return ( DxLib::KeyInputString( x , y ,maxLength , str , isEscCancel ) == 1 );
908 }else{
909 return ( DxLib::KeyInputSingleCharString( x , y ,maxLength , str , isEscCancel ) == 1 );
910 }
911 }
912
918 static int Number(int x,int y,int min,int max,int isEscCancel)
919 {
920 return DxLib::KeyInputNumber( x , y , max , min , isEscCancel );
921 }
922
925 static bool StartTextMode( int 最大文字数 , bool ESCキャンセル可能フラグ , bool 半角文字限定フラグ , bool 数値入力限定フラグ )
926 {
927 if( handle != NULL_HANDLE )
928 {
929 handle = DxLib::MakeKeyInput( 最大文字数 , ESCキャンセル可能フラグ , 半角文字限定フラグ , 数値入力限定フラグ );
930 }
931 DxLib::SetActiveKeyInput( handle );
932 }
933
935 static int CheckText()
936 {
937 return DxLib::CheckKeyInput( handle );
938 }
939
941 static bool DrawText(int X座標 , int Y座標 )
942 {
943 DxLib::DrawKeyInputString( X座標 , Y座標 , handle );
944 }
945
947 static bool SetText( const char* 文字列 )
948 {
949 DxLib::SetKeyInputString( 文字列 , handle );
950 }
951 static bool SetText( int 数値 )
952 {
953 DxLib::SetKeyInputNumber( 数値 , handle );
954 }
955
957 static bool GetText( char* 出力バッファ )
958 {
959 return !GetKeyInputString( 出力バッファ , handle );
960 }
961
962
963 /*
965 static int SetKeyColor(int 入力文字色 , int IME非使用時カーソル色 ,
966 int IME使用時文字色 , int IME使用時カーソル色 ,
967 int 変換時下線色 , int IME使用時変換候補色 ,
968 int 入力モード名色 , int 入力文字縁色 ,
969 int 変換候補縁色 , int 入力モード名縁色 ,
970 int 変換候補ウィンドウ縁色 , int 変換候補ウィンドウ色 )
971 {
972 return DxLib::SetKeyInputStringColor( nmlStr , nmlCur , imeStr , imeCur , imeLine , imeSelectStr , imeModeStr , nmlStrE , imeSelectStrE , imeModeStrE , imeSelectWinE , imeSelectWinF );
973 }
974 */
975
976 };
977
978 }
DXFW::Joypad::Reset
void Reset()
summary&gt;状態の更新
Definition: Input.h:284
DXFW::Keyboard::Reset
void Reset()
状態のリセット
Definition: Input.h:609
DXFW::Joypad::Make
void Make(PadType パッドタイプ)
summary&gt;状態のリセット
Definition: Input.h:278
DXFW::KeyCode
KeyCode
キーボードコード
Definition: Input.h:60
DXFW::PadType
PadType
ゲームパッドの種類
Definition: Input.h:12
DXFW::Key::Reset
void Reset()
summary&gt;押下状態の更新
Definition: Input.h:199
DXFW::Keyboard
キーボード入力
Definition: Input.h:495
DXFW::Keyboard::Update
bool Update()
状態の更新
Definition: Input.h:718
DXFW::Input::Reset
static void Reset()
状態をリセット
Definition: Input.h:884
DXFW::Input::Number
static int Number(int x, int y, int min, int max, int isEscCancel)
Definition: Input.h:918
DXFW::Joypad::GetCount
static int GetCount()
接続中のパッド数を取得
Definition: Input.h:398
DXFW::NextFrame::End
コマの進む向きをマイナスにしてから進む
DXFW::Joypad::StickY
int StickY
summary&gt;パッドの作成
Definition: Input.h:275
DXFW::Input
キーやマウスによる入力管理クラス
Definition: Input.h:870
DXFW::Joypad::SetInputToKey
bool SetInputToKey(PadCode padInput, KeyCode keyInput1, KeyCode keyInput2=KeyCode::Null, KeyCode keyInput3=KeyCode::Null, KeyCode keyInput4=KeyCode::Null)
Definition: Input.h:378
DXFW::Key
各ボタンとキーを表すクラスsummary&gt;ジョイパッド入力
Definition: Input.h:183
DXFW::Mouse::SetVisible
bool SetVisible(bool 表示フラグ)
summary&gt;カーソル位置を移動
Definition: Input.h:481
DXFW::Input::Text
static bool Text(int x, int y, int maxLength, char *str, int isEscCancel, bool isSingleOnly=false)
Definition: Input.h:903
DXFW::Mouse
マウス入力
Definition: Input.h:405
DXFW::Input::StartTextMode
static bool StartTextMode(int 最大文字数, bool ESCキャンセル可能フラグ, bool 半角文字限定フラグ, bool 数値入力限定フラグ)
summary&gt;テキスト入力モードの確認
Definition: Input.h:925
DXFW::Joypad::StartVibration
bool StartVibration(double power, int time)
summary&gt;パッドの振動を停止する
Definition: Input.h:386
DXFW::Joypad::GetInputType
PadType GetInputType()
パッドタイプの取得
Definition: Input.h:365
DXFW::Input::CheckText
static int CheckText()
summary&gt;テキストの描画
Definition: Input.h:935
DXFW::Mouse::Reset
void Reset()
状態のリセット
Definition: Input.h:437
DXFW::Input::Update
static void Update()
状態を更新
Definition: Input.h:892
DXFW::PadCode
PadCode
ゲームパッドコード
Definition: Input.h:23
DXFW::MouseCode
MouseCode
マウスボタンコード
Definition: Input.h:170
DXFW::Joypad::SetInputType
void SetInputType(PadType inputPudType)
パッドタイプの設定
Definition: Input.h:371
DXFW::Mouse::Update
bool Update()
状態の更新
Definition: Input.h:455
DXFW::Keyboard::HoldAnyKey
static bool HoldAnyKey()
いずれかのキーが押されているか取得
Definition: Input.h:832
DXFW::Input::DrawText
static bool DrawText(int X座標, int Y座標)
summary&gt;テキストの設定
Definition: Input.h:941
DXFW::Input::SetText
static bool SetText(int 数値)
summary&gt;テキストの取得
Definition: Input.h:951
DXFW::Joypad
Definition: Input.h:226
DXFW::FileMode::Add
書込のみ
DXFW::Key::Key
Key()
summary&gt;キーのリセット
Definition: Input.h:191