本文整理汇总了C++中Input::GetQualifiers方法的典型用法代码示例。如果您正苦于以下问题:C++ Input::GetQualifiers方法的具体用法?C++ Input::GetQualifiers怎么用?C++ Input::GetQualifiers使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Input
的用法示例。
在下文中一共展示了Input::GetQualifiers方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: HandleMouseButtonUp
void UI::HandleMouseButtonUp(StringHash eventType, VariantMap& eventData)
{
if (inputDisabled_ || consoleVisible_)
return;
using namespace MouseButtonUp;
unsigned button = eventData[P_BUTTON].GetUInt();
IntVector2 pos;
Input* input = GetSubsystem<Input>();
pos = input->GetMousePosition();
int qualifiers = input->GetQualifiers();
#ifdef ATOMIC_PLATFORM_WINDOWS
bool superdown = input->GetKeyDown(KEY_LCTRL) || input->GetKeyDown(KEY_RCTRL);
#else
bool superdown = input->GetKeyDown(KEY_LGUI) || input->GetKeyDown(KEY_RGUI);
#endif
MODIFIER_KEYS mod = GetModifierKeys(qualifiers, superdown);
if (button == MOUSEB_RIGHT)
rootWidget_->InvokeRightPointerUp(pos.x_, pos.y_, mod);
else
rootWidget_->InvokePointerUp(pos.x_, pos.y_, mod, false);
}
示例2: HandleMouseButtonDown
void UI::HandleMouseButtonDown(StringHash eventType, VariantMap& eventData)
{
if (inputDisabled_ || consoleVisible_)
return;
using namespace MouseButtonDown;
unsigned button = eventData[P_BUTTON].GetUInt();
IntVector2 pos;
pos = GetSubsystem<Input>()->GetMousePosition();
Input* input = GetSubsystem<Input>();
int qualifiers = input->GetQualifiers();
#ifdef ATOMIC_PLATFORM_WINDOWS
bool superdown = input->GetKeyDown(KEY_LCTRL) || input->GetKeyDown(KEY_RCTRL);
#else
bool superdown = input->GetKeyDown(KEY_LGUI) || input->GetKeyDown(KEY_RGUI);
#endif
MODIFIER_KEYS mod = GetModifierKeys(qualifiers, superdown);
static double last_time = 0;
static int counter = 1;
Time* t = GetSubsystem<Time>();
double time = t->GetElapsedTime() * 1000;
if (time < last_time + 600)
counter++;
else
counter = 1;
last_time = time;
if (button == MOUSEB_RIGHT)
rootWidget_->InvokeRightPointerDown(pos.x_, pos.y_, counter, mod);
else
rootWidget_->InvokePointerDown(pos.x_, pos.y_, counter, mod, false);
}
示例3: HandleKey
void UI::HandleKey(bool keydown, int keycode, int scancode)
{
if (keydown && (keycode == KEY_ESCAPE || keycode == KEY_RETURN || keycode == KEY_RETURN2 || keycode == KEY_KP_ENTER)
&& TBWidget::focused_widget)
{
SendEvent(E_UIWIDGETFOCUSESCAPED);
}
#ifdef ATOMIC_PLATFORM_WINDOWS
if (keycode == KEY_LCTRL || keycode == KEY_RCTRL)
return;
#else
if (keycode == KEY_LGUI || keycode == KEY_RGUI)
return;
#endif
Input* input = GetSubsystem<Input>();
int qualifiers = input->GetQualifiers();
#ifdef ATOMIC_PLATFORM_WINDOWS
bool superdown = input->GetKeyDown(KEY_LCTRL) || input->GetKeyDown(KEY_RCTRL);
#else
bool superdown = input->GetKeyDown(KEY_LGUI) || input->GetKeyDown(KEY_RGUI);
#endif
MODIFIER_KEYS mod = GetModifierKeys(qualifiers, superdown);
SPECIAL_KEY specialKey = TB_KEY_UNDEFINED;
switch (keycode)
{
case KEY_RETURN:
case KEY_RETURN2:
case KEY_KP_ENTER:
specialKey = TB_KEY_ENTER;
break;
case KEY_F1:
specialKey = TB_KEY_F1;
break;
case KEY_F2:
specialKey = TB_KEY_F2;
break;
case KEY_F3:
specialKey = TB_KEY_F3;
break;
case KEY_F4:
specialKey = TB_KEY_F4;
break;
case KEY_F5:
specialKey = TB_KEY_F5;
break;
case KEY_F6:
specialKey = TB_KEY_F6;
break;
case KEY_F7:
specialKey = TB_KEY_F7;
break;
case KEY_F8:
specialKey = TB_KEY_F8;
break;
case KEY_F9:
specialKey = TB_KEY_F9;
break;
case KEY_F10:
specialKey = TB_KEY_F10;
break;
case KEY_F11:
specialKey = TB_KEY_F11;
break;
case KEY_F12:
specialKey = TB_KEY_F12;
break;
case KEY_LEFT:
specialKey = TB_KEY_LEFT;
break;
case KEY_UP:
specialKey = TB_KEY_UP;
break;
case KEY_RIGHT:
specialKey = TB_KEY_RIGHT;
break;
case KEY_DOWN:
specialKey = TB_KEY_DOWN;
break;
case KEY_PAGEUP:
specialKey = TB_KEY_PAGE_UP;
break;
case KEY_PAGEDOWN:
specialKey = TB_KEY_PAGE_DOWN;
break;
case KEY_HOME:
specialKey = TB_KEY_HOME;
break;
case KEY_END:
specialKey = TB_KEY_END;
break;
case KEY_INSERT:
specialKey = TB_KEY_INSERT;
break;
case KEY_TAB:
specialKey = TB_KEY_TAB;
//.........这里部分代码省略.........
示例4: HandleKey
void UI::HandleKey(bool keydown, int keycode, int scancode)
{
#ifdef ATOMIC_PLATFORM_WINDOWS
if (keycode == KEY_LCTRL || keycode == KEY_RCTRL)
return;
#else
if (keycode == KEY_LGUI || keycode == KEY_RGUI)
return;
#endif
Input* input = GetSubsystem<Input>();
int qualifiers = input->GetQualifiers();
#ifdef ATOMIC_PLATFORM_WINDOWS
bool superdown = input->GetKeyDown(KEY_LCTRL) || input->GetKeyDown(KEY_RCTRL);
#else
bool superdown = input->GetKeyDown(KEY_LGUI) || input->GetKeyDown(KEY_RGUI);
#endif
MODIFIER_KEYS mod = GetModifierKeys(qualifiers, superdown);
switch (keycode)
{
case KEY_RETURN:
case KEY_RETURN2:
case KEY_KP_ENTER:
InvokeKey(rootWidget_, 0, TB_KEY_ENTER, mod, keydown);
break;
case KEY_F1:
InvokeKey(rootWidget_, 0, TB_KEY_F1, mod, keydown);
break;
case KEY_F2:
InvokeKey(rootWidget_, 0, TB_KEY_F2, mod, keydown);
break;
case KEY_F3:
InvokeKey(rootWidget_, 0, TB_KEY_F3, mod, keydown);
break;
case KEY_F4:
InvokeKey(rootWidget_, 0, TB_KEY_F4, mod, keydown);
break;
case KEY_F5:
InvokeKey(rootWidget_, 0, TB_KEY_F5, mod, keydown);
break;
case KEY_F6:
InvokeKey(rootWidget_, 0, TB_KEY_F6, mod, keydown);
break;
case KEY_F7:
InvokeKey(rootWidget_, 0, TB_KEY_F7, mod, keydown);
break;
case KEY_F8:
InvokeKey(rootWidget_, 0, TB_KEY_F8, mod, keydown);
break;
case KEY_F9:
InvokeKey(rootWidget_, 0, TB_KEY_F9, mod, keydown);
break;
case KEY_F10:
InvokeKey(rootWidget_, 0, TB_KEY_F10, mod, keydown);
break;
case KEY_F11:
InvokeKey(rootWidget_, 0, TB_KEY_F11, mod, keydown);
break;
case KEY_F12:
InvokeKey(rootWidget_, 0, TB_KEY_F12, mod, keydown);
break;
case KEY_LEFT:
InvokeKey(rootWidget_, 0, TB_KEY_LEFT, mod, keydown);
break;
case KEY_UP:
InvokeKey(rootWidget_, 0, TB_KEY_UP, mod, keydown);
break;
case KEY_RIGHT:
InvokeKey(rootWidget_, 0, TB_KEY_RIGHT, mod, keydown);
break;
case KEY_DOWN:
InvokeKey(rootWidget_, 0, TB_KEY_DOWN, mod, keydown);
break;
case KEY_PAGEUP:
InvokeKey(rootWidget_, 0, TB_KEY_PAGE_UP, mod, keydown);
break;
case KEY_PAGEDOWN:
InvokeKey(rootWidget_, 0, TB_KEY_PAGE_DOWN, mod, keydown);
break;
case KEY_HOME:
InvokeKey(rootWidget_, 0, TB_KEY_HOME, mod, keydown);
break;
case KEY_END:
InvokeKey(rootWidget_, 0, TB_KEY_END, mod, keydown);
break;
case KEY_INSERT:
InvokeKey(rootWidget_, 0, TB_KEY_INSERT, mod, keydown);
break;
case KEY_TAB:
InvokeKey(rootWidget_, 0, TB_KEY_TAB, mod, keydown);
break;
case KEY_DELETE:
InvokeKey(rootWidget_, 0, TB_KEY_DELETE, mod, keydown);
break;
case KEY_BACKSPACE:
InvokeKey(rootWidget_, 0, TB_KEY_BACKSPACE, mod, keydown);
//.........这里部分代码省略.........