本文整理汇总了C++中CKey::GetRightThumbY方法的典型用法代码示例。如果您正苦于以下问题:C++ CKey::GetRightThumbY方法的具体用法?C++ CKey::GetRightThumbY怎么用?C++ CKey::GetRightThumbY使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CKey
的用法示例。
在下文中一共展示了CKey::GetRightThumbY方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetAction
void CButtonTranslator::GetAction(WORD wWindow, const CKey &key, CAction &action)
{
CStdString strAction;
// try to get the action from the current window
WORD wAction = GetActionCode(wWindow, key, strAction);
// if it's invalid, try to get it from the global map
if (wAction == 0)
wAction = GetActionCode( (WORD) -1, key, strAction);
// Now fill our action structure
action.wID = wAction;
action.strAction = strAction;
action.fAmount1 = 1; // digital button (could change this for repeat acceleration)
action.fAmount2 = 0;
action.fRepeat = key.GetRepeat();
action.m_dwButtonCode = key.GetButtonCode();
// get the action amounts of the analog buttons
if (key.GetButtonCode() == KEY_BUTTON_LEFT_ANALOG_TRIGGER)
{
action.fAmount1 = (float)key.GetLeftTrigger() / 255.0f;
}
else if (key.GetButtonCode() == KEY_BUTTON_RIGHT_ANALOG_TRIGGER)
{
action.fAmount1 = (float)key.GetRightTrigger() / 255.0f;
}
else if (key.GetButtonCode() == KEY_BUTTON_LEFT_THUMB_STICK)
{
action.fAmount1 = key.GetLeftThumbX();
action.fAmount2 = key.GetLeftThumbY();
}
else if (key.GetButtonCode() == KEY_BUTTON_RIGHT_THUMB_STICK)
{
action.fAmount1 = key.GetRightThumbX();
action.fAmount2 = key.GetRightThumbY();
}
else if (key.GetButtonCode() == KEY_BUTTON_LEFT_THUMB_STICK_UP)
action.fAmount1 = key.GetLeftThumbY();
else if (key.GetButtonCode() == KEY_BUTTON_LEFT_THUMB_STICK_DOWN)
action.fAmount1 = -key.GetLeftThumbY();
else if (key.GetButtonCode() == KEY_BUTTON_LEFT_THUMB_STICK_LEFT)
action.fAmount1 = -key.GetLeftThumbX();
else if (key.GetButtonCode() == KEY_BUTTON_LEFT_THUMB_STICK_RIGHT)
action.fAmount1 = key.GetLeftThumbX();
else if (key.GetButtonCode() == KEY_BUTTON_RIGHT_THUMB_STICK_UP)
action.fAmount1 = key.GetRightThumbY();
else if (key.GetButtonCode() == KEY_BUTTON_RIGHT_THUMB_STICK_DOWN)
action.fAmount1 = -key.GetRightThumbY();
else if (key.GetButtonCode() == KEY_BUTTON_RIGHT_THUMB_STICK_LEFT)
action.fAmount1 = -key.GetRightThumbX();
else if (key.GetButtonCode() == KEY_BUTTON_RIGHT_THUMB_STICK_RIGHT)
action.fAmount1 = key.GetRightThumbX();
}
示例2: if
CAction::CAction(int actionID, const CStdString &name, const CKey &key)
{
m_id = actionID;
m_name = name;
m_amount[0] = 1; // digital button (could change this for repeat acceleration)
for (unsigned int i = 1; i < max_amounts; i++)
m_amount[i] = 0;
m_repeat = key.GetRepeat();
m_buttonCode = key.GetButtonCode();
m_unicode = 0;
m_holdTime = key.GetHeld();
// get the action amounts of the analog buttons
if (key.GetButtonCode() == KEY_BUTTON_LEFT_ANALOG_TRIGGER)
m_amount[0] = (float)key.GetLeftTrigger() / 255.0f;
else if (key.GetButtonCode() == KEY_BUTTON_RIGHT_ANALOG_TRIGGER)
m_amount[0] = (float)key.GetRightTrigger() / 255.0f;
else if (key.GetButtonCode() == KEY_BUTTON_LEFT_THUMB_STICK)
{
m_amount[0] = key.GetLeftThumbX();
m_amount[1] = key.GetLeftThumbY();
}
else if (key.GetButtonCode() == KEY_BUTTON_RIGHT_THUMB_STICK)
{
m_amount[0] = key.GetRightThumbX();
m_amount[1] = key.GetRightThumbY();
}
else if (key.GetButtonCode() == KEY_BUTTON_LEFT_THUMB_STICK_UP)
m_amount[0] = key.GetLeftThumbY();
else if (key.GetButtonCode() == KEY_BUTTON_LEFT_THUMB_STICK_DOWN)
m_amount[0] = -key.GetLeftThumbY();
else if (key.GetButtonCode() == KEY_BUTTON_LEFT_THUMB_STICK_LEFT)
m_amount[0] = -key.GetLeftThumbX();
else if (key.GetButtonCode() == KEY_BUTTON_LEFT_THUMB_STICK_RIGHT)
m_amount[0] = key.GetLeftThumbX();
else if (key.GetButtonCode() == KEY_BUTTON_RIGHT_THUMB_STICK_UP)
m_amount[0] = key.GetRightThumbY();
else if (key.GetButtonCode() == KEY_BUTTON_RIGHT_THUMB_STICK_DOWN)
m_amount[0] = -key.GetRightThumbY();
else if (key.GetButtonCode() == KEY_BUTTON_RIGHT_THUMB_STICK_LEFT)
m_amount[0] = -key.GetRightThumbX();
else if (key.GetButtonCode() == KEY_BUTTON_RIGHT_THUMB_STICK_RIGHT)
m_amount[0] = key.GetRightThumbX();
}