本文整理汇总了C++中CKeySet::GetKeyByTag方法的典型用法代码示例。如果您正苦于以下问题:C++ CKeySet::GetKeyByTag方法的具体用法?C++ CKeySet::GetKeyByTag怎么用?C++ CKeySet::GetKeyByTag使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CKeySet
的用法示例。
在下文中一共展示了CKeySet::GetKeyByTag方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: FindKeyDefinitionById
//------------------------------------------------------------------------------
// Locate a key definition by key identifier only
// NOTE: Group are searched from upper group(menus,..) to lower group (aircraft)
//------------------------------------------------------------------------------
CKeyDefinition* CKeyMap::FindKeyDefinitionById (Tag id)
{ CKeyDefinition *rc = NULL;
for (U_INT k=0; k< oset.size();k++)
{ CKeySet *ks = oset[k];
CKeyDefinition* kdf = ks->GetKeyByTag(id);
if (0 == kdf) continue;
return kdf;
}
return 0;
}
示例2: Stroke
//-------------------------------------------------------------------------
// Change group callback if key is redirected
//-------------------------------------------------------------------------
// Activate key in group (simulate a key stroke)
// The group is taken from the Keydef in case of redirection
//-------------------------------------------------------------------------
bool CKeyMap::Stroke(Tag grp,Tag kid)
{ //--- find the Key set ---------------------------
CKeySet *ks = FindKeySetById (grp);
if (0 == ks) return false;
CKeyDefinition *kdf = ks->GetKeyByTag(kid);
if (0 == kdf) return false;
//--- Group Redirection --------------------------
Tag ngp = kdf->GetSet();
ks = FindKeySetById (ngp);
KeyGroupCB cb = ks->GetCB();
return (cb)(kdf,kdf->GetCode()) ;
}