Module

# Cursors

<div class="rst-class">

forsearch

</div>

Mouse

<div class="rst-class">

forsearch

</div>

Cursor

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

## Description

Contains a library of standard mouse <span class="title-ref">Cursors</span>.

## Methods

<div class="rst-class">

table-centered_column_4

</div>

| Name                 | Parameters | Returns | Shared |
|----------------------|------------|---------|--------|
| `Hide<cursors.hide>` |            |         |        |
| `Show<cursors.show>` |            |         |        |

## Method descriptions

<div id="cursors.hide">

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

</div>

<div class="rst-class">

forsearch

</div>

Cursors.Hide

**Hide**

> Hides the cursor.
>
> You can also make the cursor disappear by specifying the InvisibleCursor and then making it reappear by specifying any visible cursor.
>
> <div class="important">
>
> <div class="title">
>
> Important
>
> </div>
>
> This method is not supported on Linux.
>
> </div>

<div id="cursors.show">

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

</div>

<div class="rst-class">

forsearch

</div>

Cursors.Show

**Show**

> Shows the cursor.
>
> If you call Hide more than once, the cursor will not reappear until you call Show same number of times that you called Hide.
>
> <div class="important">
>
> <div class="title">
>
> Important
>
> </div>
>
> This method is not supported on Linux.
>
> </div>

## Notes

The <span class="title-ref">Cursors</span> module contains a library of standard mouse <span class="title-ref">Cursors</span> that you can access by calling `System</api/os/system>`.Cursors.MouseCursorName, where *MouseCursorName* is one of the following:

| MouseCursorName         | Description                                                                                                                                                          |
|-------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ArrowAllDirections      | A set of four arrows pointing in both the North/South and East/West dimensions. It is typically used when moving objects on Windows.                                 |
| ArrowEastWest           | A pair of arrows pointing in the East and West directions. It is typically used when resizing something horizontally.                                                |
| ArrowNortheastSouthwest | A pair of arrows pointing Northeast and Southwest directions. It is typically used when resizing something in this diagonal direction.                               |
| ArrowNorthSouth         | A pair of arrows pointing North and South. It is typically used when resizing something vertically.                                                                  |
| ArrowNorthwestSoutheast | A pair of arrows pointing in the Northwest and Southeast directions. It is typically used when resizing something in this diagonal direction.                        |
| Copy                    | The copy mouse cursor indicates that something is being copied. On macOS it displays an arrow with a + icon in it.                                                   |
| FingerPointer           | This cursor shows one finger pointing up indicating the presence of a hyperlink.                                                                                     |
| HandClosed              | This cursor is typically used in conjunction with the HandOpen cursor to indicate that something has been grabbed and the drag is taking place.                      |
| HandOpen                | This is the open hand cursor that is typically used to indicate that something can be grabbed.                                                                       |
| IBeam                   | The text insertion cursor that indicates that text can be entered into the object. Use this in place of the deprecated global function IBeamCursor.                  |
| InvisibleCursor         | The cursor is invisible.                                                                                                                                             |
| MagnifyLarger           | The cursor is a magnifying class with a + sign to indicate that clicking will magnify (zoom in on) the image.                                                        |
| MagnifySmaller          | The cursor is a magnifying class with a - sign to indicate that clicking will reduce (zoom out on) the image.                                                        |
| SplitterEastWest        | A pair of arrows pointing East and West with a vertical bar between them. This is typically used when dragging a vertical splitter control.                          |
| SplitterNorthSouth      | A pair of arrows pointing North and South with a horizontal bar between them. This is typically used when dragging a horizontal splitter control.                    |
| StandardPointer         | The standard system arrow cursor that is used for normal operations. You can use this in place of the deprecated global function ArrowCursor.                        |
| Wait                    | The system wait cursor that is used when a long operation is in progress and you cannot provide other feedback. Use this in place of the deprecated global function. |

## Sample code

The following code in the MouseDown event of a `Canvas</api/user_interface/desktop/desktopcanvas>` changes the cursor to the HandClosed cursor. Returning `True</api/language/true>` allows the MouseUp event to get called.

``` xojo
Me.MouseCursor = System.Cursors.HandClosed
Return True
```

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

The following MouseDown event handler for a `Canvas</api/user_interface/desktop/desktopcanvas>` changes the cursor to a Magnifying class if the user presses the mouse button while holding down the Alt key and the Magnify Smaller cursor if the user is holding down the Control key. Return `True</api/language/true>` so that the MouseUp event is called.

``` xojo
If Keyboard.AsyncAltKey Then
  Me.MouseCursor = System.Cursors.MagnifyLarger
ElseIf Keyboard.AsyncControlKey Then
  Me.MouseCursor = System.Cursors.MagnifySmaller
End If

Return True
```

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

The following code in the MouseUp event restores the standard cursor.

``` xojo
Me.MouseCursor = System.Cursors.StandardPointer
```

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

The following code in the MouseEnter event hides the cursor.

``` xojo
System.Cursors.Hide
```

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

The following code in the MouseExit event shows the cursor.

``` xojo
System.Cursors.Show
```

## Compatibility

|                       |         |
|-----------------------|---------|
| **Project Types**     | Desktop |
| **Operating Systems** | All     |

<div class="seealso">

`DesktopApplication</api/user_interface/desktop/desktopapplication>`, `DesktopControl</api/user_interface/desktop/desktopcontrol>`, `MouseCursor</api/user_interface/desktop/mousecursor>`, `DesktopWindow</api/user_interface/desktop/desktopwindow>` classes; `System</api/os/system>` module

</div>
