示例#1
0
文件: view.cpp 项目: kg/ppsspp
bool Clickable::Key(const KeyInput &key) {
	if (!HasFocus() && key.deviceId != DEVICE_ID_MOUSE) {
		down_ = false;
		return false;
	}
	// TODO: Replace most of Update with this.
	bool ret = false;
	if (key.flags & KEY_DOWN) {
		if (IsAcceptKey(key)) {
			down_ = true;
			ret = true;
		}
	}
	if (key.flags & KEY_UP) {
		if (IsAcceptKey(key)) {
			if (down_) {
				Click();
				down_ = false;
				ret = true;
			}
		} else if (IsEscapeKey(key)) {
			down_ = false;
		}
	}
	return ret;
}
示例#2
0
文件: search.cpp 项目: robotenok/MILF
void CSearchDialog::OnCharHook(wxKeyEvent& event)
{
    if (IsEscapeKey(event))
    {
        EndDialog(wxID_CANCEL);
        return;
    }

    event.Skip();
}
示例#3
0
void wxDialogBase::OnCharHook(wxKeyEvent& event)
{
    if ( IsEscapeKey(event) )
    {
        if ( SendCloseButtonClickEvent() )
        {
            // Skip the call to event.Skip() below, we did handle this key.
            return;
        }
    }

    event.Skip();
}