GaitGeneration by Graph Search
読み取り中…
検索中…
一致する文字列を見つけられません
keyboard.h
[詳解]
1
3
4// Copyright(c) 2023-2025 Design Engineering Laboratory, Saitama University
5// Released under the MIT license
6// https://opensource.org/licenses/mit-license.php
7
8#ifndef DESIGNLAB_KEYBOARD_H_
9#define DESIGNLAB_KEYBOARD_H_
10
11#include <array>
12
13
14namespace designlab
15{
16
19class Keyboard final
20{
21public:
22 Keyboard();
23
24
27 void Update();
28
33 int GetPressingCount(const int key_code) const;
34
39 int GetReleasingCount(const int key_code) const;
40
41private:
42 static const int kKeyNum = 256;
43
49 bool IsAvailableCode(const int key_code) const;
50
51 std::array<int, kKeyNum> key_pressing_counter_;
52 std::array<int, kKeyNum> key_releasing_counter_;
53};
54
55} // namespace designlab
56
57
58#endif // DESIGNLAB_KEYBOARD_H_
Dxlibのキーボード入力を取得するクラス.
Definition keyboard.h:20
int GetReleasingCount(const int key_code) const
keyCodeのキーが離されているフレーム数を取得する.
Definition keyboard.cpp:68
void Update()
キー入力を更新する. これを毎フレーム実行しないと,キー入力を取得できない.
Definition keyboard.cpp:25
int GetPressingCount(const int key_code) const
keyCodeのキーが押されているフレーム数を取得する.
Definition keyboard.cpp:58