Instruction set reference
HIPE_OP_EDIT_STATUS
Used to determine which edit actions are available, i.e. applicable to the currently selected content or focused element. This is useful for creating an 'Edit' menu with unavailable options removed.
The answer describes the frame an edit action would apply to, under the same rules as HIPE_OP_EDIT_ACTION: a top-level client may query any child frame (and if the keyboard focus isn't inside that frame, focus is moved to it, as for an edit action), while any other client gets an answer only while the keyboard focus is inside its own frame or the child frame it names. Otherwise every action is reported as unavailable.
- location: 0 to query the current frame, or the location of a child frame.
- arg[0]: A string of "action code" characters for the functions that may be required. See below.
Action codes
| Character | Editing operation |
|---|---|
| z | Undo |
| Z | Redo |
| a | Select all |
| x | Cut selected text to clipboard |
| c | Copy selected text to clipboard |
| v | Paste selected text from clipboard, matching destination formatting |
| V | Paste selected text from clipboard, preserving source formatting if applicable |
| b | Toggles bold if applicable |
| i | Toggles italic if applicable |
| u | Toggles underline if applicable |
| k | Toggles strikethrough if applicable |
| l | Align left if applicable |
| C | Align center if applicable |
| r | Align right if applicable |
| j | Align justified if applicable |
| d | Set text direction default |
| > | Set text direction left to right |
| < | Set text direction right to left |
| t | Insert text, or delete the selected text (available when the text cursor or selection is in editable content) |
Notes
The server responds with a HIPE_OP_EDIT_STATUS instruction. Its arg[0] repeats the action codes that were asked about, and its arg[1] holds one status character for each of them, in the same order:
- 0 — available (and, for a toggle such as bold, not currently on);
- 1 — available, and currently on (for toggles such as bold);
- e — not available now, or not a recognised action code.
For example, asking about "zxcv" might return "0ee0": undo and paste are available, but cut and copy aren't because no text is selected.
Paste is reported as available whenever there is something to paste into, even for a client that isn't top-level; whether such a client may actually paste also depends on recent user input (see HIPE_OP_EDIT_ACTION).
