SDXFrameWork  0.13
SDXFrameWork
 All Classes Namespaces Functions Variables Enumerations Enumerator Pages
Public Member Functions | Static Public Member Functions | Public Attributes | Friends | List of all members
SDX::Keyboard Class Reference

キーボードの状態を表すクラス. More...

#include <Keyboard.h>

Public Member Functions

void Reset ()
 状態のリセット. More...
 
void Update ()
 状態の更新. More...
 
Keyoperator[] (KeyCode index)
 KeyCodeでアクセス. More...
 

Static Public Member Functions

static bool HoldAnyKey ()
 いずれかのキーが押されているか取得. More...
 

Public Attributes

Key Back
 キー
 
Key Tab
 キー
 
Key Return
 キー
 
Key LShift
 キー
 
Key RShift
 キー
 
Key LControl
 キー
 
Key RControl
 キー
 
Key Escape
 キー
 
Key Space
 キー
 
Key PageUp
 キー
 
Key PageDown
 キー
 
Key End
 キー
 
Key Home
 キー
 
Key Left
 キー
 
Key Up
 キー
 
Key Right
 キー
 
Key Down
 キー
 
Key Insert
 キー
 
Key Delete
 キー
 
Key Minus
 キー
 
Key Yen
 キー
 
Key PrevTrack
 キー
 
Key Period
 キー
 
Key Slash
 キー
 
Key LAlt
 キー
 
Key RAlt
 キー
 
Key Scroll
 キー
 
Key Semicolon
 キー
 
Key Colon
 キー
 
Key LBracket
 キー
 
Key RBracket
 キー
 
Key At
 キー
 
Key Backslash
 キー
 
Key Comma
 キー
 
Key Capslock
 キー
 
Key Pause
 キー
 
Key Numpad0
 キー
 
Key Numpad1
 キー
 
Key Numpad2
 キー
 
Key Numpad3
 キー
 
Key Numpad4
 キー
 
Key Numpad5
 キー
 
Key Numpad6
 キー
 
Key Numpad7
 キー
 
Key Numpad8
 キー
 
Key Numpad9
 キー
 
Key Multiply
 キー
 
Key Add
 キー
 
Key Subtract
 キー
 
Key Decimal
 キー
 
Key Divide
 キー
 
Key NUMPADEnter
 キー
 
Key F1
 キー
 
Key F2
 キー
 
Key F3
 キー
 
Key F4
 キー
 
Key F5
 キー
 
Key F6
 キー
 
Key F7
 キー
 
Key F8
 キー
 
Key F9
 キー
 
Key F10
 キー
 
Key F11
 キー
 
Key F12
 キー
 
Key A
 キー
 
Key B
 キー
 
Key C
 キー
 
Key D
 キー
 
Key E
 キー
 
Key F
 キー
 
Key G
 キー
 
Key H
 キー
 
Key I
 キー
 
Key J
 キー
 
Key K
 キー
 
Key L
 キー
 
Key M
 キー
 
Key N
 キー
 
Key O
 キー
 
Key P
 キー
 
Key Q
 キー
 
Key R
 キー
 
Key S
 キー
 
Key T
 キー
 
Key U
 キー
 
Key V
 キー
 
Key W
 キー
 
Key X
 キー
 
Key Y
 キー
 
Key Z
 キー
 
Key _0
 キー
 
Key _1
 キー
 
Key _2
 キー
 
Key _3
 キー
 
Key _4
 キー
 
Key _5
 キー
 
Key _6
 キー
 
Key _7
 キー
 
Key _8
 キー
 
Key _9
 キー
 

Friends

class Input
 

Detailed Description

キーボードの状態を表すクラス.

//Copyright © 2014 SDXFramework
//[License]GNU Affero General Public License, version 3
//[Contact]http://sourceforge.jp/projects/dxframework/
//入力を取得する
bool SampleInput()
{
using namespace SDX;
System::Initialise("sample", 640, 480);
std::string message = "クリックするかZキーを押して";
while (System::Update())
{
if (Input::mouse.Left.on){ message = "クリックした"; }
if (Input::mouse.Left.off){ message = "離した"; }
if (Input::key[KeyCode::Z].hold){ message = "Zを押している"; }//列挙子でのキー指定も可能
if (Input::key.Z.holdCount > 60){ message = "Zを長押し"; }
//マウスの位置に文字を描画
if (Input::key.Return.on){ break;}//Enterで終了
}
return true;
}

Member Function Documentation

void SDX::Keyboard::Reset ( )
inline

状態のリセット.

void SDX::Keyboard::Update ( )
inline

状態の更新.

static bool SDX::Keyboard::HoldAnyKey ( )
inlinestatic

いずれかのキーが押されているか取得.

Key& SDX::Keyboard::operator[] ( KeyCode  index)
inline

KeyCodeでアクセス.

KeyCode::COUNTや範囲外の場合Returnを返す