SDXFrameWork  0.09
SDXFrameWork
 All Classes Namespaces Functions Variables Enumerations Enumerator Pages
Public Member Functions | Public Attributes | List of all members
SDX::Key Class Reference

各ボタンとキーを表すクラス. More...

#include <Key.h>

Public Member Functions

void Reset ()
 キーのリセット. More...
 
void Update (int 押下フラグ)
 押下状態の更新. More...
 

Public Attributes

bool on = false
 
bool off = false
 
bool hold = false
 
unsigned int holdCount = 0
 

Detailed Description

各ボタンとキーを表すクラス.

//©SDXFramework http://sourceforge.jp/projects/dxframework/
//🍣入力を取得する
bool SampleInput()
{
using namespace SDX;
System::Initialise("sample", 600, 400);
std::string message = "";
while (System::Update())
{
if (Input::mouse.Left.on) message = "クリックした";
if (Input::mouse.Left.off) message = "離した";
if (Input::key.Z.hold ) message = "Zを押している";
if (Input::key.Z.holdCount > 60 ) message = "Zを長押し";
//マウスの位置に文字を描画
Drawing::String({ Input::mouse.x, Input::mouse.y }, Color::White, message.c_str());
if (Input::key.Return.on) break;//Enterで終了
}
return true;
}

Member Function Documentation

void SDX::Key::Reset ( )

キーのリセット.

void SDX::Key::Update ( int  押下フラグ)

押下状態の更新.