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

📄 mouse.doc

📁 这是一个C++编程文档
💻 DOC
📖 第 1 页 / 共 4 页
字号:
-----------------------------------------------------------------------
Mouse::Released()

Syntax:		int Released(int button)

Description:	In manual mode, this checks to see if button has been
		released since the last call to this command. In event
		driven mode, this checks to see if the current event
		was triggered by button being released. button can be 0
		(LEFTBUTTON), 1 (RIGHTBUTTON), or 2 (CENTERBUTTON).

Return Value:	1 if button has a released event, 0 otherwise.

-----------------------------------------------------------------------
Mouse::LB_Dn()

Syntax: 	unsigned char LB_Dn(void)

Description:	Returns the status of the left button.

Return Value:	1 if the left button is pressed, 0 otherwise.

-----------------------------------------------------------------------
Mouse::RB_Dn()

Syntax: 	unsigned char RB_Dn(void)

Description:	Returns the status of the right button.

Return Value:	1 if the right button is pressed, 0 otherwise.

-----------------------------------------------------------------------
Mouse::CB_Dn()

Syntax: 	unsigned char CB_Dn(void)

Description:	Returns the status of the center button.

Return Value:	1 if the center button is pressed, 0 otherwise.

-----------------------------------------------------------------------
Mouse::xLimit()

Syntax: 	void xLimit(int min, int max)

Description:	Sets the limit that the cursor can move in the x-
		direction. min & max must be pixel values even if the
		screen is in text mode.

Return Value:	None.

-----------------------------------------------------------------------
Mouse::yLimit()

Syntax: 	void yLimit(int min, int max)

Description:	Sets the limit that the cursor can move in the y-
		direction. min & max must be pixel values even if the
		screen is in text mode.

Return Value:	None.


-----------------------------------------------------------------------
Mouse::xyLimit()

Syntax: 	void xyLimit(int xmin, int xmax, int ymin, int ymax)

Description:	Sets the limits that the cursor can move in the x- &
		y-direction. Limits must be pixel values even if the
		screen is in text mode.

Return Value:	None.


-----------------------------------------------------------------------
Mouse::GetVideoPage(void);

Syntax: 	int GetVideoPage(void)

Description:	Gets the video page number for which the mouse cursor
		is currently active. This may or may not be the same
		as the video page that is currently being displayed on
		the screen.

Return Value:	The number of the mouse cursor's current video page.

-----------------------------------------------------------------------
Mouse::SetVideoPage(void);

Syntax:		void SetVideoPage(int page);

Description:	Sets the video page for which the mouse cursor will be
		active. Normally this will be the same as the displayed
		video page but it does not have to be.

Return Value:	None.

-----------------------------------------------------------------------
Mouse::SetCursor()

Syntax: 	void SetCursor(TextCursor& cursor)
		void SetCursor(GraphicsCursor& cursor)
		void SetCursor(ColorGraphicsCursor& cursor)

Description:	Sets the text cursor as described by the TextCursor
		class or the graphics cursor as described by the
                GraphicsCursor or ColorGraphicsCursor class.

Return Value:	None.

-----------------------------------------------------------------------
Mouse::MickToPix()

Syntax: 	void MickToPix(int horiz, int vert)

Description:	Sets the mickey-to-pixel ratio. A mickey is a motion
		signal sent by the mouse and occurs every 1/200th inch
		for most mice. horiz passes the number of mickeys re-
		quired for an 8 pixel horizontal movement, and vert
		passes the number of mickeys required for an 8 pixel
		vertical movement. The constructor sets these to 8 and
		16, respectively.

Return Value:	None.

-----------------------------------------------------------------------
Mouse::SetSpeedThreshold()

Syntax: 	void SetSpeedThreshold(unsigned speed)

Defaults:	speed = 64

Description:	Sets the threshold at which the cursor speed doubles.
		speed is in mickeys-per-second. Supposedly, this func-
		tion is only available for Logitech mice.

Return Value:	None.

-----------------------------------------------------------------------
Mouse::InBox()

Syntax: 	int InBox(int left, int top, int right, int bottom)

Description:	Checks if the mouse cursor is located within a rec-
		tangle. Rectangle limits should be in pixels regardless
		of screen mode.

Return Value:	1 if the cursor is in the rectangle, 0 otherwise.

-----------------------------------------------------------------------
Mouse::Exclude()

Syntax: 	void Exclude(int left, int top, int right, int bottom)

Description:	Sets up an exclusion area in which the mouse cursor
		automatically turns itself off. This is not the same as
		the exclude function that is built into the mouse, and
		must be continuously called in a loop. Rectangle limits
		should be in pixels regardless of screen mode.

Return Value:	None.

-----------------------------------------------------------------------
Mouse::SetClickThreshold()

Syntax: 	void SetClickThreshold(unsigned time)

Defaults:	time = 250 (ms)

Description:	Sets the threshold at which sequential clicks are regi-
		stered as multi-clicks. time is in milliseconds.

Return Value:	None.

-----------------------------------------------------------------------
Mouse::MultiClick()

Syntax: 	int MultiClick(int button)

Description:	Checks for multi-clicks of a button. button can be 0
		(LEFTBUTTON), 1 (RIGHTBUTTON), or 2 (CENTERBUTTON).

Return Value:	Current number of multi-clicks.

-----------------------------------------------------------------------
Mouse::DoubleClick()

Syntax: 	int DoubleClick(int button)

Description:	Checks for double-clicks of a button. button can be 0
		(LEFTBUTTON), 1 (RIGHTBUTTON), or 2 (CENTERBUTTON).

Return Value:	1 if button has been double-clicked, 0 otherwise.

-----------------------------------------------------------------------
Mouse::ClearClick()

Syntax: 	void ClearClick(int button)

Defaults:	button = 7 (all buttons)

Description:	Resets the multi-click status of button. button can be
		0 (LEFTBUTTON), 1 (RIGHTBUTTON), or 2 (CENTERBUTTON).

Return Value:	None.

-----------------------------------------------------------------------
Mouse::SetRepeatRate()

Syntax: 	void SetRepeatRate(unsigned char button,
                                   unsigned delay, unsigned rate);

Defaults:	button = LEFTBUTTON
		delay  = 250 (ms)
                rate   = 150 (ms)

Description:	Sets the threshold at which sequential clicks are regi-
		stered as multi-clicks. time is in milliseconds and de-
		faults to 250.

Return Value:	None.

-----------------------------------------------------------------------
Mouse::InstallHandler()

Syntax: 	void InstallHandler(unsigned mask,
				    void interrupt (*fn)(void))
Alt. Syntax:	void InstallHandler(MouseEventHandler handler)

Defaults:	fn = MouseHandler()

Description:	Installs an interrupt handler function which is automa-
		tically run whenever an event occurs that is included
                in the mask. The mouse driver loads the CPU registers
                with mouse information before calling the function.
                Therefore, the first action should be to save this in-
                formation to an event buffer, which can be accomplished
                by calling the Save() function. The remaining function
                code should be kept to a minimum, and the function MUST
                be terminated with the EventExit() macro. The mask bits
                are described in Table X. If a function pointer is not
                passed in the parameter list, then the default handler
                MouseHandler() will be used.

Return Value:	None.

-----------------------------------------------------------------------
Mouse::Save()

Syntax: 	void Save(int event, int button, int x, int y,
			  int xcount, int ycount)

Description:	Stores the passed parameters in the event buffer. This
		should be the first function called from an event hand-
		ler routine. See the default handler MouseHandler() for
		details.

Return Value:	None.

-----------------------------------------------------------------------
Mouse::GetEvent()

Syntax: 	void GetEvent(void)

Description:	Gets the next event from the event buffer and loads the
		parameters into class variables.

Return Value:	None.

-----------------------------------------------------------------------
Mouse::ClearEvent()

Syntax: 	void ClearEvent(void)

Description:	Clears the current event from the internal class varia-
		bles.

Return Value:	None.

-----------------------------------------------------------------------
Mouse::ClearBuffer()

Syntax: 	void ClearBuffer(void)

Description:	Clears the event buffer.

Return Value:	None.

-----------------------------------------------------------------------

References
1.  Kent Porter, "Mouse Mysteries, Part I: Text", Turbo Technix, Vol. 
    1, No. 4, pp. 52-67, May/June 1988.
2.  Kent Porter, "Mouse Mysteries, Part II: Graphics", Turbo Technix, 
    Vol. 1, No. 5, pp. 42-53, July/August 1988.
3.  Terry Dettmann, DOS Programmers Reference, Part V: Reference, Mouse 
    Functions, pp. 717-739, Que, 1989.
4.  Ralf Brown, Interrupt List, Release 31, July 12, 1992. This is 
    available in the Public Domain as INTER31A.ZIP, INTER31B.ZIP, and
    INTER31C.ZIP.

⌨️ 快捷键说明

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