keyhandler.cpp

来自「最新官方例子,图形,描述副,基本控件,通讯协议,等等,」· C++ 代码 · 共 45 行

CPP
45
字号
/**
 *
 * @brief Definition of TKeyHandler
 *
 * Copyright (c) EMCC Software Ltd 2003
 * @version 1.0
 */
// User includes
#include "KeyHandler.h"


/*
* C++ constructor
*/
TKeyHandler::TKeyHandler()
	{
	}

/*
* Key handler state accessor
* @return a bit pattern indicating which keys are currently pressed
*/
TInt TKeyHandler::State() const
	{
	return iDirection;
	}

/*
* Key handler state mutator
* @param aKey the key that's being set or unset
* @param aState a boolean flag to indicate whether the button is being pressed or released
*/
void TKeyHandler::SetState(TKeyHandler::TKeyState aKey, TBool aState)
    {
    if (aState)
    	{
        iDirection |= static_cast <TInt> (aKey);
		}
    else
    	{
        iDirection &= static_cast <TInt> (~aKey);
		}
    }

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?