MGL(Win32)
読み取り中…
検索中…
一致する文字列を見つけられません
include
mgl
input
keyboard
mgl_keyboard.h
[詳解]
1
// SPDX-License-Identifier: Zlib
2
/* ------------------------------------------------------------------------- */
9
/* ------------------------------------------------------------------------- */
10
11
#ifndef INCGUARD_MGL_KEYBOARD_H_1609136230
12
#define INCGUARD_MGL_KEYBOARD_H_1609136230
13
14
#include <
mgl/input/keyboard/mgl_keyboard_server.h
>
15
#include <
mgl/mgl_environment.h
>
16
17
namespace
MGL::Input
18
{
20
class
Keyboard
21
{
22
public
:
23
/* ------------------------------------------------------------------------- */
27
/* ------------------------------------------------------------------------- */
28
Keyboard
() noexcept
29
: _server(
KeyboardServer
::GetInstance())
30
{}
31
32
/* ------------------------------------------------------------------------- */
37
/* ------------------------------------------------------------------------- */
38
constexpr
KeyboardServer
&
GetServer
() noexcept
39
{
40
return
_server;
41
}
42
43
/* ------------------------------------------------------------------------- */
49
/* ------------------------------------------------------------------------- */
50
[[nodiscard]]
bool
IsAvailable
() const noexcept
51
{
52
return
_server.
IsAvailable
();
53
}
54
55
/* ------------------------------------------------------------------------- */
62
/* ------------------------------------------------------------------------- */
63
[[nodiscard]]
bool
IsPressing
(
Keycode
keycode)
const
noexcept
64
{
65
return
_server.
IsPressing
(keycode);
66
}
67
68
/* ------------------------------------------------------------------------- */
75
/* ------------------------------------------------------------------------- */
76
[[nodiscard]]
bool
IsTriggered
(
Keycode
keycode)
const
noexcept
77
{
78
return
_server.
IsTriggered
(keycode);
79
}
80
81
/* ------------------------------------------------------------------------- */
88
/* ------------------------------------------------------------------------- */
89
[[nodiscard]]
bool
IsReleased
(
Keycode
keycode)
const
noexcept
90
{
91
return
_server.
IsReleased
(keycode);
92
}
93
94
/* ------------------------------------------------------------------------- */
101
/* ------------------------------------------------------------------------- */
102
[[nodiscard]]
bool
IsARepeat
(
Keycode
keycode)
const
noexcept
103
{
104
return
_server.
IsARepeat
(keycode);
105
}
106
107
/* ------------------------------------------------------------------------- */
112
/* ------------------------------------------------------------------------- */
113
constexpr
void
SetRepeatSetting
(
const
RepeatSetting
&repeatSetting)
noexcept
114
{
115
_server.
SetRepeatSetting
(repeatSetting);
116
}
117
118
/* ------------------------------------------------------------------------- */
123
/* ------------------------------------------------------------------------- */
124
[[nodiscard]]
constexpr
const
RepeatSetting
&
GetRepeatSetting
() const noexcept
125
{
126
return
_server.
GetRepeatSetting
();
127
}
128
129
/* ------------------------------------------------------------------------- */
135
/* ------------------------------------------------------------------------- */
136
[[nodiscard]]
constexpr
bool
IsConnecting
() const noexcept
137
{
138
return
_server.
IsConnecting
();
139
}
140
141
private
:
142
KeyboardServer
&_server;
143
};
144
}
// namespace MGL::Input
145
146
#endif
// INCGUARD_MGL_KEYBOARD_H_1609136230
147
148
// vim: et ts=4 sw=4 sts=4
MGL::Input::Keyboard
キーボード入力取得クラス
Definition
mgl_keyboard.h:21
MGL::Input::Keyboard::GetServer
constexpr KeyboardServer & GetServer() noexcept
キーボードサーバの取得
Definition
mgl_keyboard.h:38
MGL::Input::Keyboard::GetRepeatSetting
constexpr const RepeatSetting & GetRepeatSetting() const noexcept
リピート入力の設定状態を取得
Definition
mgl_keyboard.h:124
MGL::Input::Keyboard::Keyboard
Keyboard() noexcept
コンストラクタ
Definition
mgl_keyboard.h:28
MGL::Input::Keyboard::IsTriggered
bool IsTriggered(Keycode keycode) const noexcept
指定したキーが押された瞬間を取得
Definition
mgl_keyboard.h:76
MGL::Input::Keyboard::SetRepeatSetting
constexpr void SetRepeatSetting(const RepeatSetting &repeatSetting) noexcept
リピート入力を設定
Definition
mgl_keyboard.h:113
MGL::Input::Keyboard::IsPressing
bool IsPressing(Keycode keycode) const noexcept
指定したキーが押されているかを取得
Definition
mgl_keyboard.h:63
MGL::Input::Keyboard::IsReleased
bool IsReleased(Keycode keycode) const noexcept
指定したキーが離された瞬間を取得
Definition
mgl_keyboard.h:89
MGL::Input::Keyboard::IsARepeat
bool IsARepeat(Keycode keycode) const noexcept
指定したキーのリピート入力状態を取得
Definition
mgl_keyboard.h:102
MGL::Input::Keyboard::IsConnecting
constexpr bool IsConnecting() const noexcept
キーボードが接続されているかを取得
Definition
mgl_keyboard.h:136
MGL::Input::Keyboard::IsAvailable
bool IsAvailable() const noexcept
キーボードサーバが有効かどうかを返す
Definition
mgl_keyboard.h:50
MGL::Input::KeyboardServer
キーボードサーバ
Definition
mgl_keyboard_server.h:28
MGL::Input::KeyboardServer::IsTriggered
bool IsTriggered(Keycode keycode) const noexcept
指定したキーが押された瞬間を取得
Definition
mgl_keyboard_server.cc:87
MGL::Input::KeyboardServer::IsAvailable
bool IsAvailable() const noexcept
キーボードサーバが有効かどうかを返す
Definition
mgl_keyboard_server.h:43
MGL::Input::KeyboardServer::IsConnecting
constexpr bool IsConnecting() const noexcept
キーボードが接続されているかを取得
Definition
mgl_keyboard_server.h:82
MGL::Input::KeyboardServer::IsReleased
bool IsReleased(Keycode keycode) const noexcept
指定したキーが離された瞬間を取得
Definition
mgl_keyboard_server.cc:103
MGL::Input::KeyboardServer::IsARepeat
bool IsARepeat(Keycode keycode) const noexcept
指定したキーのリピート入力状態を取得
Definition
mgl_keyboard_server.cc:119
MGL::Input::KeyboardServer::GetRepeatSetting
constexpr const RepeatSetting & GetRepeatSetting() const noexcept
リピート入力の設定状態を取得
Definition
mgl_keyboard_server.h:70
MGL::Input::KeyboardServer::IsPressing
bool IsPressing(Keycode keycode) const noexcept
指定したキーが押されているかを取得
Definition
mgl_keyboard_server.cc:73
MGL::Input::KeyboardServer::SetRepeatSetting
constexpr void SetRepeatSetting(const RepeatSetting &repeatSetting) noexcept
リピート入力を設定
Definition
mgl_keyboard_server.h:59
mgl_environment.h
MGL 環境定義
MGL::Input::Keycode
Keycode
キーボード用コード
Definition
mgl_keyboard_keycode.h:23
mgl_keyboard_server.h
MGL キーボードサーバ
MGL::Input::RepeatSetting
リピート設定
Definition
mgl_input_repeat.h:25
構築:
1.12.0