本文整理汇总了C++中MCStack::kdown方法的典型用法代码示例。如果您正苦于以下问题:C++ MCStack::kdown方法的具体用法?C++ MCStack::kdown怎么用?C++ MCStack::kdown使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MCStack
的用法示例。
在下文中一共展示了MCStack::kdown方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: wkdown
Boolean MCDispatch::wkdown(Window w, const char *string, KeySym key)
{
if (menu != NULL)
return menu->kdown(string, key);
MCStack *target = findstackd(w);
if (target == NULL || !target->kdown(string, key))
{
if (MCmodifierstate & MS_MOD1)
{
MCButton *bptr = MCstacks->findmnemonic(MCS_tolower(string[0]));
if (bptr != NULL)
{
bptr->activate(True, (uint2)key);
return True;
}
}
}
else
if (target != NULL)
return True;
return False;
}
示例2: MCWindowProc
//.........这里部分代码省略.........
buffer[0] = buffer[1] = 0;
if (msg == WM_CHAR || msg == WM_SYSCHAR)
buffer[0] = lastchar = wParam;
// MW-2010-11-17: [[ Bug 3892 ]] Ctrl+Alt can be the same as AltGr.
// If we are a CHAR message *and* have a non-control character *and* have Ctrl+Alt set, we discard the modifiers
if ((msg == WM_CHAR || msg == WM_SYSCHAR) && wParam >= 32 && (MCmodifierstate & (MS_CONTROL | MS_ALT)) == (MS_CONTROL | MS_ALT))
MCmodifierstate = 0;
if (curinfo->keysym == 0) // event came from some other dispatch
keysym = pms->getkeysym(wParam, lParam);
else
keysym = curinfo->keysym;
lastkeysym = keysym;
if (MCmodifierstate & MS_CONTROL)
if (wParam == VK_CANCEL || keysym == '.')
{
if (MCallowinterrupts && !MCdefaultstackptr->cantabort())
curinfo->abort = True;
else
MCinterrupt = True;
}
else
if (msg == WM_KEYDOWN)
buffer[0] = lastchar = wParam;
if (curinfo->dispatch)
{
if (MCtracewindow == DNULL || hwnd != (HWND)MCtracewindow->handle.window)
{
uint2 count = LOWORD(lParam);
while (count--)
{
if (!MCdispatcher->wkdown(dw, buffer, keysym)
&& (msg == WM_SYSKEYDOWN || msg == WM_SYSCHAR))
return IsWindowUnicode(hwnd) ? DefWindowProcW(hwnd, msg, wParam, lParam) : DefWindowProcA(hwnd, msg, wParam, lParam);
if (count || lParam & 0x40000000)
MCdispatcher->wkup(dw, buffer, keysym);
}
curinfo->handled = curinfo->reset = True;
}
}
else
{
MCEventnode *tptr = new MCEventnode(hwnd, msg, wParam, lParam, keysym,
MCmodifierstate, MCeventtime);
pms->appendevent(tptr);
}
}
break;
case WM_KEYUP:
case WM_SYSKEYUP:
{
if (curinfo->keysym == 0) // event came from some other dispatch
keysym = pms->getkeysym(wParam, lParam);
else
keysym = curinfo->keysym;
if (keysym == lastkeysym)
buffer[0] = lastchar;
else
buffer[0] = 0;
buffer[1] = 0;
if (curinfo->dispatch)
{
if (MCtracewindow == DNULL || hwnd != (HWND)MCtracewindow->handle.window)
{