Module: AMS::Cursor

Defined in:
docs/ams/cursor.rb

Overview

Note:

Windows only!

The Cursor namespace contains functions that are subjected to Windows cursor.

Since:

  • 2.0.0

Class Method Summary collapse

Class Method Details

.clear_clipBoolean

Unclip cursor.

Returns:

  • (Boolean)

    success

Since:

  • 2.0.0

.clip_to_main_windowBoolean

Clip cursor to main window.

Returns:

  • (Boolean)

    success

Since:

  • 2.0.0

.clip_to_viewportBoolean

Clip cursor to view window.

Returns:

  • (Boolean)

    success

Since:

  • 2.0.0

.get_clip_rect(mode = 1) ⇒ Array<Integer>

Get upper-left and lower-right coordinates of the cursor clip rectangle.

Parameters:

  • mode (Integer) (defaults to: 1)
    1. Retrieve coordinates relative to screen origin.
    2. Retrieve coordinates relative to the viewport origin.

Returns:

  • (Array<Integer>)

    [x1,y1, x2,y2]

Since:

  • 2.0.0

.get_pos(mode = 1) ⇒ Array<Integer>

Get cursor position.

Parameters:

  • mode (Integer) (defaults to: 1)
    1. Retrieve coordinates relative to screen origin.
    2. Retrieve coordinates relative to the viewport origin.

Returns:

  • (Array<Integer>)

    [x,y]

Since:

  • 2.0.0

.is_main_window_target?Boolean

Determine whether cursor is pointing at the main window.

Returns:

  • (Boolean)

Since:

  • 2.0.0

.is_viewport_target?Boolean

Determine whether cursor is within the view client area.

Returns:

  • (Boolean)

Since:

  • 2.0.0

.is_visible?Boolean

Determine whether cursor is visible.

Returns:

  • (Boolean)

Since:

  • 2.0.0

.set_clip_rect(x1, y1, x2, y2, mode = 1) ⇒ Boolean

Set upper-left and lower-right coordinates of the cursor clip rectangle.

Parameters:

  • x1 (Integer)

    X coordinate of the upper-left corner of the rect.

  • y1 (Integer)

    Y coordinate of the upper-left corner of the rect.

  • x2 (Integer)

    X coordinate of the lower-right corner of the rect.

  • y2 (Integer)

    Y coordinate of the lower-right corner of the rect.

  • mode (Integer) (defaults to: 1)
    1. Given coordinates are relative to screen origin.
    2. Given coordinates are relative to the viewport origin.

Returns:

  • (Boolean)

    success

Since:

  • 2.0.0

.set_pos(x, y, mode = 1) ⇒ Boolean

Set cursor position.

Parameters:

  • x (Integer)
  • y (Integer)
  • mode (Integer) (defaults to: 1)
    1. Given coordinates are relative to screen origin.
    2. Given coordinates are relative to the viewport origin.

Returns:

  • (Boolean)

    success

Since:

  • 2.0.0

.show(state) ⇒ Boolean

Show/hide cursor.

Parameters:

  • state (Boolean)

Returns:

  • (Boolean)

    Whether cursor visibility state was changed.

Since:

  • 2.0.0