OpenSiv3D  v0.6.5
C++20 framework for creative coding
s3d::Input Class Reference

入力オブジェクト More...

#include <Input.hpp>

Public Member Functions

SIV3D_NODISCARD_CXX20 Input ()=default
 
constexpr SIV3D_NODISCARD_CXX20 Input (InputDeviceType deviceType, uint8 code, uint8 playerIndex=0) noexcept
 
constexpr InputDeviceType deviceType () const noexcept
 デバイスの種類を返します。 More...
 
constexpr uint8 code () const noexcept
 
constexpr uint8 playerIndex () const noexcept
 
String name () const
 入力オブジェクトの名前を返します。 More...
 
bool down () const
 入力オブジェクトが現在のフレームで押され始めたかを返します。 More...
 
bool pressed () const
 入力オブジェクトが押されているかを返します。 More...
 
bool up () const
 入力オブジェクトが現在のフレームで離されたかを返します。 More...
 
Duration pressedDuration () const
 入力オブジェクトが押され続けている時間を返します。 More...
 
constexpr InputCombination operator+ (Input other) const noexcept
 
InputGroup operator| (Input other) const
 
InputGroup operator| (const InputCombination &other) const
 
InputGroup operator| (const InputGroup &other) const
 
constexpr uint32 asUint32 () const noexcept
 

Friends

constexpr friend bool operator== (Input lhs, Input rhs) noexcept
 
constexpr friend bool operator!= (Input lhs, Input rhs) noexcept
 
constexpr friend bool operator< (Input lhs, Input rhs) noexcept
 
constexpr friend bool operator<= (Input lhs, Input rhs) noexcept
 
constexpr friend bool operator> (Input lhs, Input rhs) noexcept
 
constexpr friend bool operator>= (Input lhs, Input rhs) noexcept
 
template<class CharType >
std::basic_ostream< CharType > & operator<< (std::basic_ostream< CharType > &output, const Input &value)
 
void Formatter (FormatData &formatData, const Input &value)
 

Detailed Description

入力オブジェクト

Remarks
キーボード、マウスのボタン、ゲームパッドのボタンなど、押下できる入力装置の要素を表現します。

Constructor & Destructor Documentation

◆ Input() [1/2]

SIV3D_NODISCARD_CXX20 s3d::Input::Input ( )
default

◆ Input() [2/2]

constexpr SIV3D_NODISCARD_CXX20 s3d::Input::Input ( InputDeviceType  deviceType,
uint8  code,
uint8  playerIndex = 0 
)
constexprnoexcept

Member Function Documentation

◆ asUint32()

constexpr uint32 s3d::Input::asUint32 ( ) const
constexprnoexcept

◆ code()

constexpr uint8 s3d::Input::code ( ) const
constexprnoexcept

◆ deviceType()

constexpr InputDeviceType s3d::Input::deviceType ( ) const
constexprnoexcept

デバイスの種類を返します。

Returns
デバイスの種類

◆ down()

bool s3d::Input::down ( ) const

入力オブジェクトが現在のフレームで押され始めたかを返します。

Returns
入力オブジェクトが現在のフレームで押され始めた場合 true, それ以外の場合は false

◆ name()

String s3d::Input::name ( ) const

入力オブジェクトの名前を返します。

Returns
入力オブジェクトの名前

◆ operator+()

constexpr InputCombination s3d::Input::operator+ ( Input  other) const
constexprnoexcept

◆ operator|() [1/3]

InputGroup s3d::Input::operator| ( const InputCombination other) const

◆ operator|() [2/3]

InputGroup s3d::Input::operator| ( const InputGroup other) const

◆ operator|() [3/3]

InputGroup s3d::Input::operator| ( Input  other) const

◆ playerIndex()

constexpr uint8 s3d::Input::playerIndex ( ) const
constexprnoexcept

◆ pressed()

bool s3d::Input::pressed ( ) const

入力オブジェクトが押されているかを返します。

Returns
入力オブジェクトが押されている場合 true, それ以外の場合は false

◆ pressedDuration()

Duration s3d::Input::pressedDuration ( ) const

入力オブジェクトが押され続けている時間を返します。

Remarks
up() が true を返すフレームまで計測結果は有効なため、if (KeyA.up()) Print << KeyA.pressedDuration() と書けます。
Returns
入力オブジェクトが押され続けている時間

◆ up()

bool s3d::Input::up ( ) const

入力オブジェクトが現在のフレームで離されたかを返します。

Returns
入力オブジェクトが現在のフレームで離された場合 true, それ以外の場合は false

Friends And Related Function Documentation

◆ Formatter

void Formatter ( FormatData formatData,
const Input value 
)
friend

◆ operator!=

constexpr friend bool operator!= ( Input  lhs,
Input  rhs 
)
friend

◆ operator<

constexpr friend bool operator< ( Input  lhs,
Input  rhs 
)
friend

◆ operator<<

template<class CharType >
std::basic_ostream<CharType>& operator<< ( std::basic_ostream< CharType > &  output,
const Input value 
)
friend

◆ operator<=

constexpr friend bool operator<= ( Input  lhs,
Input  rhs 
)
friend

◆ operator==

constexpr friend bool operator== ( Input  lhs,
Input  rhs 
)
friend

◆ operator>

constexpr friend bool operator> ( Input  lhs,
Input  rhs 
)
friend

◆ operator>=

constexpr friend bool operator>= ( Input  lhs,
Input  rhs 
)
friend

The documentation for this class was generated from the following file: