本文整理汇总了C++中CKeySet::GetCB方法的典型用法代码示例。如果您正苦于以下问题:C++ CKeySet::GetCB方法的具体用法?C++ CKeySet::GetCB怎么用?C++ CKeySet::GetCB使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CKeySet
的用法示例。
在下文中一共展示了CKeySet::GetCB方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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()) ;
}
示例2: KeyPress
//------------------------------------------------------------------------------
// Keyboard Key pressed
//------------------------------------------------------------------------------
void CKeyMap::KeyPress (U_INT key, EKeyboardModifiers mod)
{ // Translate key and modifier into keycode
int code = (mod << 16) + key;
bool handled = false;
//--- special detection mode ------------------------------
if(m_bKeyDetect && m_fKeyCallback)
{
/// \todo unbind if this key code is already asigned
if (m_fKeyCallback(m_winID, code)) return;
}
//---Standard key -----------------------------------------
for (U_INT k=0; (k<oset.size()); k++)
{ CKeySet *ks = oset[k];
CKeyDefinition *kdf = ks->GetKeyByCode(code);
if (0 == kdf) continue;
//---Call the redirected group key callback -----------
Tag ngp = kdf->GetSet();
ks = FindKeySetById (ngp);
KeyGroupCB cb = ks->GetCB();
handled = (cb)(kdf,code);
if (handled) return;
}
return;
}