SDXFrameWork  0.07
SDXFrameWork
 全て クラス ネームスペース 関数 変数 列挙型 列挙型の値 ページ
Public メソッド | Public 変数 | すべてのメンバ一覧
クラス SDX::Key

各ボタンとキーを表すクラス. [詳細]

#include <Key.h>

Public メソッド

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

Public 変数

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

説明

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

//入力を取得する
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;
}

関数

void SDX::Key::Reset ( )

キーのリセット.

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

押下状態の更新.