Hex Editor - Binary File Editing Software for Windows
Download Hex Editor Neo Hide this button

ICursor Interface

ICursor interface is implemented by a cursor object. Each document view has a single read-only instance of a cursor object, which can be used to manage editor window's multiple cursors.

Declaration

interface ICursor {
    // Properties
    readonly ${offset}: number;
    readonly ${singleCursor}: boolean;
    readonly ${all}: number[];

    // Methods
    ${move}(action: ${CursorAction}, flags = ${ActionFlags}.None): void;
    ${moveTo}(offset: number, flags = ${ActionFlags}.None): void;
}
// This interface is not available in managed environment
// This interface is not available in native environment

ICursor Properties

offset

readonly offset: number;
// This property is not available in managed environment
// This property is not available in native environment

Returns the main cursor offset.

singleCursor

readonly singleCursor: boolean;
// This property is not available in managed environment
// This property is not available in native environment

Returns true if the cursor object has only a single cursor and false otherwise.

all

readonly all: number[];
// This property is not available in managed environment
// This property is not available in native environment

Returns all cursors in an array.

ICursor Methods

move

move(action: ${CursorAction}, flags = ${ActionFlags}.None): void;
// This method is not available in managed environment
// This method is not available in native environment
action
A type of cursor movement.
flags
Optional key modifiers.

Emulates the pressing of a specified keyboard key. Optional flags may add a key modifier to the action.

// Move the cursor two cells down
activeView.cursor.move(CursorAction.Down);
activeView.cursor.move(CursorAction.Down);
// Select the next row of data
activeView.cursor.move(CursorAction.Down, ActionFlags.Shift);

moveTo

moveTo(offset: number, flags = ${ActionFlags}.None): void;
// This method is not available in managed environment
// This method is not available in native environment
offset
An offset within a document where you want the cursor to move to. May be beyond the current size of a document.
flags
Optional key modifiers.

Move the cursor to a given offset. If ActionFlags.Alt modifier is set, adds new alternate cursor. If ActionFlags.Shift modifier and optionally ActionFlags.Ctrl are set, modifies the current selection.

// Move the cursor to 0x100, deleting all alternate cursors
activeView.cursor.moveTo(0x100);
// Add new alternate cursor at 0x200
activeView.cursor.moveTo(0x200, ActionFlags.Alt);