Mouse and Keyboard
+ Collaboration diagram for Mouse and Keyboard:

Enumerations

enum  t_modifiers {
  eCommandKey, eShiftKey, eControlKey, eAltKey,
  eLeftButton, eRightButton, eMiddleButton, ePopupMenu,
  eCapsLock, eAutoRepeat
}
 Bit mask values for various meta-key presses on the keyboard. More...
 
enum  t_jmouse_cursortype {
  JMOUSE_CURSOR_NONE, JMOUSE_CURSOR_ARROW, JMOUSE_CURSOR_WAIT, JMOUSE_CURSOR_IBEAM,
  JMOUSE_CURSOR_CROSSHAIR, JMOUSE_CURSOR_COPYING, JMOUSE_CURSOR_POINTINGHAND, JMOUSE_CURSOR_DRAGGINGHAND,
  JMOUSE_CURSOR_RESIZE_LEFTRIGHT, JMOUSE_CURSOR_RESIZE_UPDOWN, JMOUSE_CURSOR_RESIZE_FOURWAY, JMOUSE_CURSOR_RESIZE_TOPEDGE,
  JMOUSE_CURSOR_RESIZE_BOTTOMEDGE, JMOUSE_CURSOR_RESIZE_LEFTEDGE, JMOUSE_CURSOR_RESIZE_RIGHTEDGE, JMOUSE_CURSOR_RESIZE_TOPLEFTCORNER,
  JMOUSE_CURSOR_RESIZE_TOPRIGHTCORNER, JMOUSE_CURSOR_RESIZE_BOTTOMLEFTCORNER, JMOUSE_CURSOR_RESIZE_BOTTOMRIGHTCORNER
}
 Mouse cursor types. More...
 

Functions

t_modifiers jkeyboard_getcurrentmodifiers ()
 Return the last known combination of modifier keys being held by the user. More...
 
t_modifiers jkeyboard_getcurrentmodifiers_realtime ()
 Return the current combination of modifier keys being held by the user. More...
 
void jmouse_getposition_global (int *x, int *y)
 Get the position of the mouse cursor in screen coordinates. More...
 
void jmouse_setposition_global (int x, int y)
 Set the position of the mouse cursor in screen coordinates. More...
 
void jmouse_setposition_view (t_object *patcherview, double cx, double cy)
 Set the position of the mouse cursor relative to the patcher canvas coordinates. More...
 
void jmouse_setposition_box (t_object *patcherview, t_object *box, double bx, double by)
 Set the position of the mouse cursor relative to a box within the patcher canvas coordinates. More...
 
void jmouse_setcursor (t_object *patcherview, t_object *box, t_jmouse_cursortype type)
 Set the mouse cursor. More...
 

Detailed Description

Enumeration Type Documentation

Mouse cursor types.

Enumerator
JMOUSE_CURSOR_NONE 

None.

JMOUSE_CURSOR_ARROW 

Arrow.

JMOUSE_CURSOR_WAIT 

Wait.

JMOUSE_CURSOR_IBEAM 

I-Beam.

JMOUSE_CURSOR_CROSSHAIR 

Crosshair.

JMOUSE_CURSOR_COPYING 

Copying.

JMOUSE_CURSOR_POINTINGHAND 

Pointing Hand.

JMOUSE_CURSOR_DRAGGINGHAND 

Dragging Hand.

JMOUSE_CURSOR_RESIZE_LEFTRIGHT 

Left-Right.

JMOUSE_CURSOR_RESIZE_UPDOWN 

Up-Down.

JMOUSE_CURSOR_RESIZE_FOURWAY 

Four Way.

JMOUSE_CURSOR_RESIZE_TOPEDGE 

Top Edge.

JMOUSE_CURSOR_RESIZE_BOTTOMEDGE 

Bottom Edge.

JMOUSE_CURSOR_RESIZE_LEFTEDGE 

Left Edge.

JMOUSE_CURSOR_RESIZE_RIGHTEDGE 

Right Edge.

JMOUSE_CURSOR_RESIZE_TOPLEFTCORNER 

Top-Left Corner.

JMOUSE_CURSOR_RESIZE_TOPRIGHTCORNER 

Top-Right Corner.

JMOUSE_CURSOR_RESIZE_BOTTOMLEFTCORNER 

Bottom-Left Corner.

JMOUSE_CURSOR_RESIZE_BOTTOMRIGHTCORNER 

Bottom-Right Corner.

Bit mask values for various meta-key presses on the keyboard.

Enumerator
eCommandKey 

Command Key.

eShiftKey 

Shift Key.

eControlKey 

Control Key.

eAltKey 

Alt Key.

eLeftButton 

Left mouse button.

eRightButton 

Right mouse button.

eMiddleButton 

Middle mouse button.

ePopupMenu 

Popup Menu (contextual menu requested)

eCapsLock 

Caps lock.

eAutoRepeat 

Key is generated by key press auto-repeat.

Function Documentation

t_modifiers jkeyboard_getcurrentmodifiers ( )

Return the last known combination of modifier keys being held by the user.

Returns
The current modifier keys that are activated.
t_modifiers jkeyboard_getcurrentmodifiers_realtime ( )

Return the current combination of modifier keys being held by the user.

Returns
The current modifier keys that are activated.
void jmouse_getposition_global ( int *  x,
int *  y 
)

Get the position of the mouse cursor in screen coordinates.

Parameters
xThe address of a variable to hold the x-coordinate upon return.
yThe address of a variable to hold the y-coordinate upon return.
void jmouse_setcursor ( t_object patcherview,
t_object box,
t_jmouse_cursortype  type 
)

Set the mouse cursor.

Parameters
patcherviewThe patcherview for which the cursor should be applied.
boxThe box for which the cursor should be applied.
typeThe type of cursor for the mouse to use.
void jmouse_setposition_box ( t_object patcherview,
t_object box,
double  bx,
double  by 
)

Set the position of the mouse cursor relative to a box within the patcher canvas coordinates.

Parameters
patcherviewThe patcherview containing the box upon which the mouse coordinates are based.
boxThe box upon which the mouse coordinates are based.
bxThe new x-coordinate of the mouse cursor position.
byThe new y-coordinate of the mouse cursor position.
void jmouse_setposition_global ( int  x,
int  y 
)

Set the position of the mouse cursor in screen coordinates.

Parameters
xThe new x-coordinate of the mouse cursor position.
yThe new y-coordinate of the mouse cursor position.
void jmouse_setposition_view ( t_object patcherview,
double  cx,
double  cy 
)

Set the position of the mouse cursor relative to the patcher canvas coordinates.

Parameters
patcherviewThe patcherview upon which the mouse coordinates are based.
cxThe new x-coordinate of the mouse cursor position.
cyThe new y-coordinate of the mouse cursor position.
  Copyright © 2015, Cycling '74