本文整理汇总了C++中KeyCode::get方法的典型用法代码示例。如果您正苦于以下问题:C++ KeyCode::get方法的具体用法?C++ KeyCode::get怎么用?C++ KeyCode::get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KeyCode
的用法示例。
在下文中一共展示了KeyCode::get方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Item
void
PressDownKeys::add(KeyCode key, KeyboardType keyboardType) {
if (key == KeyCode::VK_NONE) return;
list_.push_back(new Item(key, keyboardType));
IOLOG_DEVEL("PressDownKeys::add key:%d, keyboardType:%d\n", key.get(), keyboardType.get());
}
示例2:
void
PressDownKeys::remove(KeyCode key, KeyboardType keyboardType) {
Item* p = static_cast<Item*>(list_.safe_front());
for (;;) {
if (!p) break;
if (p->key == key &&
p->keyboardType == keyboardType) {
p = static_cast<Item*>(list_.erase_and_delete(p));
} else {
p = static_cast<Item*>(p->getnext());
}
}
IOLOG_DEVEL("PressDownKeys::remove key:%d, keyboardType:%d\n", key.get(), keyboardType.get());
}
示例3: if
void
KeyboardRepeat::set(EventType eventType,
Flags flags,
KeyCode key,
KeyboardType keyboardType,
int delayUntilRepeat,
int keyRepeat)
{
if (! queue_) return;
if (key == KeyCode::VK_NONE) return;
if (eventType == EventType::MODIFY) {
goto cancel;
} else if (eventType == EventType::UP) {
// The repetition of plural keys is controlled by manual operation.
// So, we ignore it.
if (queue_->size() != 1) return;
// We stop key repeat only when the repeating key is up.
KeyboardRepeat::Item* p = static_cast<KeyboardRepeat::Item*>(queue_->front());
if (p && (p->params).type == ParamsUnion::KEYBOARD) {
Params_KeyboardEventCallBack* params = (p->params).params.params_KeyboardEventCallBack;
if (params && key == params->key) {
goto cancel;
}
}
} else if (eventType == EventType::DOWN) {
cancel();
primitive_add(eventType, flags, key, keyboardType, Item::TYPE_NORMAL);
primitive_start(delayUntilRepeat, keyRepeat);
IOLOG_DEVEL("KeyboardRepeat::set key:%d flags:0x%x\n", key.get(), flags.get());
} else {
goto cancel;
}
return;
cancel:
cancel();
}
示例4: set
void KeyboardRepeat::set(EventType eventType,
Flags flags,
KeyCode key,
KeyboardType keyboardType,
int delayUntilRepeat,
int keyRepeat) {
if (key == KeyCode::VK_NONE) return;
if (eventType == EventType::MODIFY) {
goto cancel;
} else if (eventType == EventType::UP) {
// The repetition of multiple keys is controlled by manual operation.
// So, we ignore it.
if (queue_.size() != 1) return;
// We stop key repeat only when the repeating key is up.
KeyboardRepeat::Item* p = static_cast<KeyboardRepeat::Item*>(queue_.safe_front());
if (p) {
auto params = (p->getParamsBase()).get_Params_KeyboardEventCallBack();
if (params && key == params->key) {
goto cancel;
}
}
} else if (eventType == EventType::DOWN) {
cancel();
primitive_add(eventType, flags, key, keyboardType);
primitive_start(delayUntilRepeat, keyRepeat);
IOLOG_DEVEL("KeyboardRepeat::set key:%d flags:0x%x\n", key.get(), flags.get());
} else {
goto cancel;
}
return;
cancel:
cancel();
}
示例5: add
// utility
void add(KeyCode newval) { add(AddDataType(BRIDGE_DATATYPE_KEYCODE), AddValue(newval.get())); }
示例6: add
// ----------------------------------------
// utility functions
void add(KeyCode newval) { add(BRIDGE_DATATYPE_KEYCODE, newval.get()); }
示例7: log
// ----------------------------------------
static void log(bool isCaught, EventType eventType, Flags flags, KeyCode key, KeyboardType keyboardType, bool repeat) {
IOLOG_DEBUG("KeyboardEventCallback [%7s]: eventType %2d, flags 0x%08x, key 0x%04x, kbdType %3d, repeat = %d\n",
isCaught ? "caught" : "sending",
eventType.get(), flags.get(), key.get(), keyboardType.get(), repeat);
}
示例8:
bool operator>=(KeyCode other) const { return value_ >= other.get(); }
示例9: add
void add(KeyToKeyType::Value type, KeyCode newval) { add(type, BRIDGE_DATATYPE_KEYCODE, newval.get()); }
示例10: add
void add(KeyToKeyType::Value type, KeyCode newval) {
add(type, AddDataType(BRIDGE_DATATYPE_KEYCODE), AddValue(newval.get()));
}