MGL(Win32)
読み取り中…
検索中…
一致する文字列を見つけられません
mgl_keyboard_delegate_event.h
[詳解]
1// SPDX-License-Identifier: Zlib
2/* ------------------------------------------------------------------------- */
9/* ------------------------------------------------------------------------- */
10
11#ifndef INCGUARD_MGL_KEYBOARD_DELEGATE_EVENT_H_1609060066
12#define INCGUARD_MGL_KEYBOARD_DELEGATE_EVENT_H_1609060066
13
14#include <mgl/mgl_environment.h>
15#if defined(MGL_KEYBOARD_DELEGATE_ENABLE_EVENT)
16
17#include <mgl/event/mgl_event.h>
19
20namespace MGL::Input
21{
23class EventKeyboardDelegate : public KeyboardDelegate
24{
25public:
26 EventKeyboardDelegate() noexcept;
27
28 void UpdateState(KeycodeArray &state) noexcept override;
29
30 /* ------------------------------------------------------------------------- */
36 /* ------------------------------------------------------------------------- */
37 [[nodiscard]] bool IsConnecting() const noexcept override
38 {
39 return true; // このデリゲートは常に接続されているものとする
40 }
41
42private:
43 static void OnEventKeyDown(void *callbackArg, void *notifyArg) noexcept;
44 static void OnEventKeyUp(void *callbackArg, void *notifyArg) noexcept;
45 static void OnEventShouldClearInput(void *callbackArg, void *notifyArg) noexcept;
46
47 void SetState(Keycode keycode, bool isPressed) noexcept;
48
49 Event::Handle _eventKeyDown;
50 Event::Handle _eventKeyUp;
51 Event::Handle _eventShouldClearInput;
52
53 KeycodeArray _temporaryState;
54};
55} // namespace MGL::Input
56
57#endif // MGL_KEYBOARD_DELEGATE_ENABLE_EVENT
58#endif // INCGUARD_MGL_KEYBOARD_DELEGATE_EVENT_H_1609060066
59
60// vim: et ts=4 sw=4 sts=4
MGL 環境定義
MGL イベント
MGL キーボード入力デリゲート基底クラス
std::bitset< kKeycodeCount > KeycodeArray
キーコード用配列のエイリアス
Definition mgl_keyboard_keycode.h:101