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::Joypad Class Reference

ジョイパッドの状態を表すクラス. More...

#include <Joypad.h>

Public Member Functions

void Open ()
 ジョイパッドを起動. More...
 
void Make (PadType パッドタイプ)
 パッドの作成. More...
 
void Reset ()
 状態のリセット. More...
 
void Update ()
 状態の更新. More...
 
PadType GetInputType ()
 パッドタイプの取得. More...
 
void SetInputType (PadType 入力タイプ)
 パッドタイプの設定. More...
 
Keyoperator[] (PadCode index)
 PadCodeでアクセス. More...
 

Static Public Member Functions

static int GetCount ()
 接続中のパッド数を取得. More...
 

Public Attributes

int StickX = 0
 ジョイスティックの横方向入力
 
int StickY = 0
 ジョイスティックの縦方向入力
 
Key Down
 キー
 
Key Left
 キー
 
Key Right
 キー
 
Key Up
 キー
 
Key Button1
 キー
 
Key Button2
 キー
 
Key Button3
 キー
 
Key Button4
 キー
 
Key Button5
 キー
 
Key Button6
 キー
 
Key Button7
 キー
 
Key Button8
 キー
 
Key Button9
 キー
 
Key Button10
 キー
 
Key Button11
 キー
 
Key Button12
 キー
 
Key Button13
 キー
 
Key Button14
 キー
 
Key Button15
 キー
 
Key Button16
 キー
 
Key Button17
 キー
 
Key Button18
 キー
 
Key Button19
 キー
 
Key Button20
 キー
 
Key Button21
 キー
 
Key Button22
 キー
 
Key Button23
 キー
 
Key Button24
 キー
 
Key Button25
 キー
 
Key Button26
 キー
 
Key Button27
 キー
 
Key Button28
 キー
 

Friends

class Input
 

Detailed Description

ジョイパッドの状態を表すクラス.

Todo:
2つ目以降のjoypad対応未実装
//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::Joypad::Open ( )
inline

ジョイパッドを起動.

void SDX::Joypad::Make ( PadType  パッドタイプ)
inline

パッドの作成.

void SDX::Joypad::Reset ( )
inline

状態のリセット.

void SDX::Joypad::Update ( )
inline

状態の更新.

PadType SDX::Joypad::GetInputType ( )
inline

パッドタイプの取得.

void SDX::Joypad::SetInputType ( PadType  入力タイプ)
inline

パッドタイプの設定.

static int SDX::Joypad::GetCount ( )
inlinestatic

接続中のパッド数を取得.

Key& SDX::Joypad::operator[] ( PadCode  index)
inline

PadCodeでアクセス.

PadCode::COUNTや範囲外の場合Button1を返す