Home

Mouse Interactions

These routines are used for capturing and processing mouse events from within an AppGraphics window. Please note that any mouse events that occur on a Windows control, such as a button, text box, etc., or a window’s menu will not be handled by these routines.

Many of the mouse functions below refer to the kind of mouse event to process. These parameters refer to the typeof mouse event, as defined by the following constants:

kind Description
MOUSE_MOVE Mouse movement in the window
MOUSE_LB_DBLCLK The left button is double-clicked
MOUSE_LB_DOWN The left button is pushed down
MOUSE_LB_UP The left button is released
MOUSE_MB_DBLCLK The middle button is double-clicked
MOUSE_MB_DOWN The middle button is pushed down
MOUSE_MB_UP The middle button is released
MOUSE_RB_DBLCLK The right button is double-clicked
MOUSE_RB_DOWN The right button is pushed down
MOUSE_RB_UP The right button is released

clearmouseclick

C void clearmouseclick (kind)
Fortran subroutine clearmouseclick (kind)

Description

Clears any queued and unprocessed mouse events of a given kind.

Parameters

Parameter C Type Fortran Type Description
kind int integer The type of mouse event to clear

getmouseclick

C void getmouseclick (kind, x, y)
Fortran subroutine getmouseclick (kind, x, y)

Description

Queries for the mouse position when an event occurred. If the event did not occur, the constant NO_CLICK is returned in both the horizontal and vertical position parameters. If an event did occur, this call removes it from the mouse event queue.

Parameters

Parameter C Type Fortran Type Description
kind int integer The type of mouse event for which to query the position
x int * integer, intent(out) The horizontal position of the mouse event in the window
y int * integer, intent(out) The vertical position of the mouse event in the window

ismouseclick

C bool ismouseclick (kind)
Fortran function ismouseclick (kind)

Description

Determines if there are mouse events of the specified kind currently awaiting processing. This call will not remove the event from the mouse event queue.

Parameters

Parameter C Type Fortran Type Description
kind int integer The type of mouse event for which to query

Return Value

C bool
Fortran logical

Returns true if a mouse event of the desired kind has occurred

mousex

C int mousex ( )
Fortran function mousex ( )

Description

Returns the current horizontal mouse position in the window. This call does not affect any mouse event queues.

Return Value

C int
Fortran integer

The horizontal mouse position

mousey

C int mousey ( )
Fortran function mousey ( )

Description

Returns the current vertical mouse position in the window. This call does not affect any mouse event queues.

Return Value

C int
Fortran integer

The vertical mouse position

registermousehandler

C void registermousehandler (kind, h)
Fortran subroutine registermousehandler (kind, h)

Description

Registers a function to be called whenever a mouse event of kind occurs. The event will still be added to the mouse event queue. The handler can always clear these events itself using clearmouseclick.

Parameters

Parameter C Type Fortran Type Description
kind int integer The type of mouse event to handle
h void h(x, y) subroutine h(x, y) A function that accepts the mouse position at the time of the event as int or integer parameters

setmousequeuestatus

C void setmousequeuestatus (kind, status)
Fortran subroutine setmousequeuestatus (kind, status)

Description

For a given kind of mouse event, sets whether such events will be queued. If queuing is disabled (the default), only the latest mouse event of each type is stored.

Parameters

Parameter C Type Fortran Type Description
kind int integer The type of mouse event to enable/disable queuing
status bool logical True to enable queuing events, false to store only the latest mouse event