⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 input_device_win32mouse.h

📁 这是一款2d游戏引擎
💻 H
字号:
/*  $Id: input_device_win32mouse.h,v 1.10 2003/10/29 13:12:43 mbn Exp $
**
**  ClanLib Game SDK
**  Copyright (C) 2003  The ClanLib Team
**  For a total list of contributers see the file CREDITS.
**
**  This library is free software; you can redistribute it and/or
**  modify it under the terms of the GNU Lesser General Public
**  License as published by the Free Software Foundation; either
**  version 2.1 of the License, or (at your option) any later version.
**
**  This library is distributed in the hope that it will be useful,
**  but WITHOUT ANY WARRANTY; without even the implied warranty of
**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
**  Lesser General Public License for more details.
**
**  You should have received a copy of the GNU Lesser General Public
**  License along with this library; if not, write to the Free Software
**  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
*/

#ifndef header_input_device_win32mouse
#define header_input_device_win32mouse

#if _MSC_VER > 1000
#pragma once
#endif

#include "../input_device_generic.h"

class CL_DisplayWindow_Win32;

class CL_InputDevice_Win32Mouse : public CL_InputDevice_Generic
{
//! Construction:
public:
	CL_InputDevice_Win32Mouse(CL_DisplayWindow_Win32 *window);

	virtual ~CL_InputDevice_Win32Mouse();

//! Attributes:
public:
	//: Returns the x position of the device.
	virtual int get_x() const;

	//: Returns the y position of the device.
	virtual int get_y() const;

	//: Returns true if the passed key code is down for this device.
	virtual bool get_keycode(int keycode) const;

	//: Key name for specified identifier (A, B, C, Space, Enter, Backspace).
	virtual std::string get_key_name(int id) const;

	//: Returns the the current position of a joystick axis.
	virtual float get_axis(int index) const;

	//: Returns the name of the device (i.e. 'Microsoft Sidewinder 3D').
	virtual std::string get_name() const;

	//: Returns the number of axes available on this device.
	virtual int get_axis_count() const;

	//: Returns the number of buttons available on this device.
	//- <p>If used on a keyboard, this function returns -1.</p>
	virtual int get_button_count() const;

//! Operations:
public:
	//: Sets the position of the device.
	virtual void set_position(int x, int y);

//! Implementation:
private:
	void on_key_down(const CL_InputEvent &event);

	void on_key_up(const CL_InputEvent &event);

	bool key_states[32];
	
	CL_DisplayWindow_Win32 *window;

	CL_SlotContainer slots;
};

#endif

⌨️ 快捷键说明

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