Class hierarchy Compound list File list Compound Members File Members

# Mouse Class Reference

This class represents the system mouse. More...

Inherits SystemInterface.

List of all members.

## Public Members

- virtual void render () = 0
    Render the mouse pointer to the screen (screen must be unlocked).

- virtual void render (Screen* S) = 0
    Old version.

- virtual void setPointer (Bitmap* Pointer, int HotSpotX=0, int HotSpotY=0) = 0
    Set the bitmap used for the mouse pointer.

- virtual void setSensitivity (float Sensitivity=1.0f) = 0
    Set the mouse sensitivity, controling its speed of motion.

- virtual long update (int x1, int y1, int x2, int y2) = 0
    This must be called to update (poll) the mouse state The parameter rectangle is the bounding box for the mouse pointer.

- virtual int getXLast () = 0
    Get polled last X state.

- virtual int getYLast () = 0
    Get polled last Y state.

- virtual int leftButtonLast () = 0
    Get polled last left button state.

- virtual int rightButtonLast () = 0
    Get polled last right button state.

- virtual int buttonLast (int Num) = 0
    Get polled last button (any) state.

- virtual int getX () = 0
    Returns current mouse X coordinate.

- virtual int getY () = 0
    Returns current mouse Y coordinate.

- virtual int leftButton () = 0
    Returns non zero if the left button (0) is pressed.

- virtual int rightButton () = 0
    Returns non zero if the right button (1) is pressed.

- virtual int button (int Num) = 0
    Returns non zero if specific (can be non-standard) button is pressed.

- virtual int getEvent (int x1, int y1, int x2, int y2) = 0
    This must be called to get a mouse event.

## Detailed Description

This class represents the system mouse.

It doesn't use the windows pointer, but rather an internal one. This class offers two way of accessing the mouse. Polling, which is less accurate, but sometimes enough. Events, which record all mouse state changes, for easy read. These ways should not be mixed. Use only one.

## Member Function Documentation

### virtual void Mouse::render() = 0`[pure virtual]`

Render the mouse pointer to the screen (screen must be unlocked).

### virtual void Mouse::render(Screen* S) = 0`[pure virtual]`

Old version.

Here for compatibility.

### virtual void Mouse::setPointer(Bitmap* Pointer, int HotSpotX=0, int HotSpotY=0) = 0`[pure virtual]`

Set the bitmap used for the mouse pointer.

Bitmap object is not retained, but rather copied, so you have to release it.

### virtual void Mouse::setSensitivity(float Sensitivity=1.0f) = 0`[pure virtual]`

Set the mouse sensitivity, controling its speed of motion.

### virtual long Mouse::update(int x1, int y1, int x2, int y2) = 0`[pure virtual]`

This must be called to update (poll) the mouse state The parameter rectangle is the bounding box for the mouse pointer.

It is used in the polling method (see above) but can be used to force the mouse to move to a certain location.

### virtual int Mouse::getXLast() = 0`[pure virtual]`

Get polled last X state.

### virtual int Mouse::getYLast() = 0`[pure virtual]`

Get polled last Y state.

### virtual int Mouse::leftButtonLast() = 0`[pure virtual]`

Get polled last left button state.

### virtual int Mouse::rightButtonLast() = 0`[pure virtual]`

Get polled last right button state.

### virtual int Mouse::buttonLast(int Num) = 0`[pure virtual]`

Get polled last button (any) state.

### virtual int Mouse::getX() = 0`[pure virtual]`

Returns current mouse X coordinate.

### virtual int Mouse::getY() = 0`[pure virtual]`

Returns current mouse Y coordinate.

### virtual int Mouse::leftButton() = 0`[pure virtual]`

Returns non zero if the left button (0) is pressed.

### virtual int Mouse::rightButton() = 0`[pure virtual]`

Returns non zero if the right button (1) is pressed.

### virtual int Mouse::button(int Num) = 0`[pure virtual]`

Returns non zero if specific (can be non-standard) button is pressed.

Buttons number ranges 0 - 3

### virtual int Mouse::getEvent(int x1, int y1, int x2, int y2) = 0`[pure virtual]`

This must be called to get a mouse event.

Returns 0 if no event, 1 if mouse moved, 2..5 if buttons (0..3) changed. The parameter rectangle is the bounding box for the mouse pointer.

The documentation for this class was generated from the following file:

- CON_Drawable.h