Instruction set reference
HIPE_OP_SET_CURSOR
Send this instruction to the display server to apply a custom mouse cursor to the specified location. The mouse cursor is generated from a character symbol and can be any unicode character for which the necessary font is available on the system.
- location: The tag element to apply the custom mouse cursor to.
- arg[0]: The character from which a mouse cursor should be generated. For example "⇖". (If you are viewing this documentation on a mobile device without symbolic fonts, that symbol might look weird.)
- arg[1]: Optional. The cursor's hotspot, the point of the symbol that sits at the mouse pointer's position, as "x,y". Each value is a fraction of the cursor's square, from 0 (left or top) to 1 (right or bottom).
| arg[1] | The symbol is drawn | The hotspot is |
|---|---|---|
| omitted | from the left edge of the square | near the symbol's top-left corner (suits arrows such as "⇖") |
| "0.5,0.5" | centred in the square | the middle of the symbol (suits "↔", "✖", "✛") |
| "0,0" to "1,1" | centred in the square | that point of the square |
Values outside 0 to 1 are treated as 0 or 1. If arg[1] isn't two numbers separated by a comma, it is ignored. A centred symbol's middle can be a pixel or two away from the square's centre, depending on the symbol's shape in its font.
Notes
As with all text data in Hipe, the character symbol is assumed to be UTF8 encoded.
Only the cursor of the body element (no location) is regenerated when the body's colours change. A cursor set on another element keeps the colours it was created with; set it again to recolour it.
