MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / OnKeyDown

Method OnKeyDown

engine/Poseidon/UI/DisplayUIMenus.cpp:1686–1714  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1684 }
1685 for (int i = 0; i < DebugConsoleExpRows; i++)
1686 {
1687 CEdit* edit = dynamic_cast<CEdit*>(GetCtrl(IDC_DEBUG_EXP1 + i));
1688 PoseidonAssert(edit);
1689 GDebugConsoleInfo.exp[i] = edit->GetText();
1690 }
1691 break;
1692 }
1693
1694 Display::OnButtonClicked(idc);
1695}
1696
1697bool DisplayDebug::OnKeyDown(unsigned nChar, unsigned nRepCnt, unsigned nFlags)
1698{
1699 if (this->GetFocused()->IDC() == IDC_DEBUG_EXP)
1700 {
1701 switch (nChar)
1702 {
1703 case SDLK_UP:
1704 if (_current > 0)
1705 {
1706 _current--;
1707 CEdit* edit = dynamic_cast<CEdit*>(GetCtrl(IDC_DEBUG_EXP));
1708 PoseidonAssert(edit);
1709 edit->SetText(GDebugConsoleInfo.history[_current]);
1710 }
1711 return true;
1712 case SDLK_DOWN:
1713 if (_current < GDebugConsoleInfo.history.Size() - 1)
1714 {
1715 _current++;
1716 CEdit* edit = dynamic_cast<CEdit*>(GetCtrl(IDC_DEBUG_EXP));
1717 PoseidonAssert(edit);

Callers

nothing calls this directly

Calls 6

GetCtrlFunction · 0.85
IDCMethod · 0.80
GetFocusedMethod · 0.45
SetTextMethod · 0.45
SizeMethod · 0.45
IsVisibleMethod · 0.45

Tested by

no test coverage detected