本文整理汇总了C++中KeyEvent::GetChar方法的典型用法代码示例。如果您正苦于以下问题:C++ KeyEvent::GetChar方法的具体用法?C++ KeyEvent::GetChar怎么用?C++ KeyEvent::GetChar使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KeyEvent
的用法示例。
在下文中一共展示了KeyEvent::GetChar方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: HandleKeyEvent
bool SchemeComponent::HandleKeyEvent(const KeyEvent & e)
{
bool componentResult = Component::HandleKeyEvent(e);
stringstream ss;
ss << "(scheme-component-handle-key-event " << this->GetComponentNum() << " ";
switch (e.GetType()) {
case KeyEvent::keyPress:
ss << "'key-press";
break;
case KeyEvent::keyRelease:
ss << "'key-release";
break;
default:
LOG_ERROR << "Error: Unknown KeyEvent type: " << e.GetType();
return componentResult;
}
ss << " #\\" << e.GetChar();
ss << ")";
scheme* sc = NULL;
pointer result;
int error;
bool schemeResult = false;
error = scheme_interpreter_evaluate_string(ss.str().c_str(), &sc, &result);
if (error) {
LOG_ERROR << "Error evaluating string: " << ss.str();
} else {
if (sc != NULL) {
schemeResult = result == sc->T;
} else {
LOG_ERROR << "Error: No pointer Scheme interpreter returned;";
}
}
return componentResult || schemeResult;
}