icekeyboard.h

来自「赫赫大名的 OGRE 游戏引擎」· C头文件 代码 · 共 46 行

H
46
字号
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/**
 *	Contains key codes.
 *	\file		IceKeyboard.h
 *	\author		Pierre Terdiman
 *	\date		April, 4, 2000
 */
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Include Guard
#ifndef __ICEKEYBOARD_H__
#define __ICEKEYBOARD_H__

	class ICECORE_API KeyboardMapping
	{
		public:
		// Constructor/Destructor
								KeyboardMapping();
								~KeyboardMapping();

				bool			CreateAccelerator(udword keycode, const char* command);
				bool			CreateAccelerator(const char* key, const char* command);
				void			DeleteAccelerators();
				const String*	GetCommand(udword keycode);
		protected:
				SymbolicList	mList;
				String			mInternal;
	};

	ICECORE_API udword			GetKeyCode(const char* key);
	// For Windows
	ICECORE_API bool			IsKeyPressed(udword key);
	// For a DOS console
	ICECORE_API bool			IsConsoleKeyPressed();
	ICECORE_API int				GetConsoleKeyPressed();

	// Accelerators
	ICECORE_API bool			SetMapping(const KeyboardMapping* mapping);
	ICECORE_API bool			CreateAccelerator(udword keycode, const char* command);
	ICECORE_API bool			CreateAccelerator(const char* key, const char* command);
	ICECORE_API void			DeleteAccelerators();
	ICECORE_API const String*	GetCommand(udword keycode);

#endif // __ICEKEYBOARD_H__

⌨️ 快捷键说明

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