本文整理汇总了C++中Flags::stripNUMPAD方法的典型用法代码示例。如果您正苦于以下问题:C++ Flags::stripNUMPAD方法的具体用法?C++ Flags::stripNUMPAD怎么用?C++ Flags::stripNUMPAD使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Flags
的用法示例。
在下文中一共展示了Flags::stripNUMPAD方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: normalizeKey
void KeyCode::normalizeKey(KeyCode& key, Flags& flags, EventType eventType, KeyboardType keyboardType) {
// We can drop NUMPAD flags, because we'll set these flags at reverseNormalizeKey.
flags.stripNUMPAD();
for (unsigned int i = 0; i < sizeof(fnkeyhack) / sizeof(fnkeyhack[0]); ++i) {
if (fnkeyhack[i].normalize(key, flags, eventType)) break;
}
}
示例2:
void
KeyCode::reverseNormalizeKey(KeyCode& key, Flags& flags, EventType eventType, KeyboardType keyboardType)
{
if (! Config::get_essential_config(BRIDGE_ESSENTIAL_CONFIG_INDEX_general_disable_numpad_hack)) {
for (unsigned int i = 0; i < sizeof(fnkeyhack) / sizeof(fnkeyhack[0]); ++i) {
if (fnkeyhack[i].reverse(key, flags, eventType)) break;
}
}
if (keyboardType == KeyboardType::POWERBOOK ||
keyboardType == KeyboardType::POWERBOOK_G4 ||
keyboardType == KeyboardType::POWERBOOK_G4_TI) {
if (key == KeyCode::ENTER) { key = KeyCode::ENTER_POWERBOOK; }
}
// ------------------------------------------------------------
// Don't add ModifierFlag::FN automatically for F-keys, PageUp/PageDown/Home/End and Forward Delete.
//
// PageUp/PageDown/Home/End and Forward Delete are entered by fn+arrow, fn+delete normally,
// And, from Cocoa Application, F-keys and PageUp,... keys have Fn modifier
// even if Fn key is not pressed actually.
// So, it's natural adding ModifierFlag::FN to these keys.
// However, there is a reason we must not add ModifierFlag::FN to there keys.
//
// Mission Control may have "fn" as shortcut key.
// If we add ModifierFlag::FN here,
// "XXX to PageUp" launches Mission Control because Mission Control recognizes fn key was pressed.
//
// It's not intended behavior from users.
// Therefore, we don't add ModifierFlag::FN for these keys.
// ------------------------------------------------------------
// set ModifierFlag::NUMPAD
flags.stripNUMPAD();
// Note: KEYPAD_CLEAR, KEYPAD_COMMA have no ModifierFlag::NUMPAD bit.
if (key == KeyCode::KEYPAD_0 || key == KeyCode::KEYPAD_1 || key == KeyCode::KEYPAD_2 ||
key == KeyCode::KEYPAD_3 || key == KeyCode::KEYPAD_4 || key == KeyCode::KEYPAD_5 ||
key == KeyCode::KEYPAD_6 || key == KeyCode::KEYPAD_7 || key == KeyCode::KEYPAD_8 ||
key == KeyCode::KEYPAD_9 ||
key == KeyCode::KEYPAD_DOT ||
key == KeyCode::KEYPAD_MULTIPLY ||
key == KeyCode::KEYPAD_PLUS ||
key == KeyCode::KEYPAD_SLASH ||
key == KeyCode::KEYPAD_MINUS ||
key == KeyCode::KEYPAD_EQUAL) {
flags.add(ModifierFlag::NUMPAD);
}
if (key == KeyCode::CURSOR_UP ||
key == KeyCode::CURSOR_DOWN ||
key == KeyCode::CURSOR_LEFT ||
key == KeyCode::CURSOR_RIGHT) {
flags.add(ModifierFlag::NUMPAD);
}
}