Skip to content
themixray edited this page Dec 16, 2021 · 11 revisions

Get pressed

Aliases: gprs, getbtns

Get buttons pressed.

pygwin.mouse.getPressed()

Returns dict

Is pressed

Aliases: isprs, btnprs

Is button pressed.

pygwin.mouse.isPressed(x)
  • x Button name (left/middle/right)

Returns bool

Get position

Aliase: gpos

Get mouse position.

pygwin.mouse.getPosition()

Returns tuple

Set position

Aliases: spos, setpos, move

Set mouse position.

pygwin.mouse.setPosition((x,y))
  • x Mouse x
  • y Mouse y

Returns None

Set visible

Set mouse visible.

pygwin.mouse.setVisible(x)
  • x Make cursor visible

Returns None

Get visible

Is mouse visible.

pygwin.mouse.getVisible()

Returns bool

Set cursor

Set mouse cursor.

pygwin.mouse.setCursor(constant)
pygwin.mouse.setCursor(size,hotspot,xormasks,andmasks)
  • constant Cursor constant
  • size Cursor size
  • hotspot Cursor hotspot
  • xormasks Cursor xormasks
  • andmasks Cursor andmasks

Returns None

Cursors

Constant                  Description
SYSTEM_CURSOR_HAND        hand
SYSTEM_CURSOR_WAIT        wait
SYSTEM_CURSOR_ARROW       arrow
SYSTEM_CURSOR_IBEAM       i-beam
SYSTEM_CURSOR_CROSSHAIR   crosshair
SYSTEM_CURSOR_NO          slashed circle or crossbones
SYSTEM_CURSOR_SIZEWE      double arrow pointing west and east
SYSTEM_CURSOR_SIZENS      double arrow pointing north and south
SYSTEM_CURSOR_WAITARROW   small wait cursor (or wait if not available)
SYSTEM_CURSOR_SIZENWSE    double arrow pointing northwest and southeast
SYSTEM_CURSOR_SIZENESW    double arrow pointing northeast and southwest
SYSTEM_CURSOR_SIZEALL     four pointed arrow pointing north, south, east, and west

Get cursor

Get mouse cursor.

pygwin.mouse.getCursor()

Returns (size,hotspot,xormasks,andmasks)

Clone this wiki locally