PMouseX:
Filter:
UGenPatterns/Classes (extension) | Streams-Patterns-Events > UGenPatterns > Generators

PMouseX
ExtensionExtension

UGenPatterns quark library

Description

Based on MouseX

NOTE: Qt GUI only (will not work on headless).

When instantiating the class for the first time, the very first reading will be erroneous. It will read the cursor as Point(0, 0). A kind of workaround is to manually set the *cursorPosition classvar before start using PMouseX or PMouseY.

Class Methods

.new

Arguments:

minval
maxval
warp

0 for linear and 1 for exponential. The symbols \linear and \exponential also work.

lag
NOTE: Might be a bit shakey when running several PMouseX or PMouseY with different lag times all at once. For efficiency they all share the same SkipJack and thereby may override each other's lag.
length

Number of values produced.

.cursorPosition

Current mouse coordinates as a Point.

.updateRate

How fast to poll the cursor position internally. Default is 0.1 seconds between each reading. Needs to be set before instantiating any PMouseX or PMouseY for the first time.

Examples