A cursor is an indicator used to show the current position on a computer monitor or other display device that will respond to input). It is a visible and moving pointer that the user controls with a mouse, touchpad, or similar input device such as a trackball. The cursor can be moved, and when a user moves it, the computer redraws it at the new location. The term "cursor" comes from the Latin word "cursorem," which means runner.
In most command-line interfaces or text editors, the text cursor, also known as a caret, is an underscore, a solid rectangle, or a vertical line, which may be flashing or steady, indicating where text will be placed when entered (the insertion point) ). In text mode displays, it was not possible to show a vertical bar between characters to show where the new text would be inserted, so an underscore or block cursor was used instead).
Cursors are often used to highlight text or objects on the screen so that they can be selected. In an operating system (OS) with a graphical user interface (GUI), the cursor is used to select and activate various user interface elements, such as menus, buttons, and windows. There are four main types of cursors: text insertion, pointing, selection, and busy.
- Text insertion cursors are used to indicate where text can be inserted. They are usually blinking lines that appear at the beginning or end of a text box.
- Pointing cursors are used to indicate where the mouse pointer is located. They are usually arrows that point in the direction the mouse is moving.
- Selection cursors are used to select text or other items. They are usually I-beams or crosshairs that appear when the mouse is over an item.
- Busy cursors are used to indicate that the computer is busy processing data. They are usually hourglasses or spinning wheels.
Cursors are also used in SQL, where they are temporary memory or temporary workstations allocated by the database server at the time of performing data manipulation language (DML) operations on the table by the user. Cursors are used to store database tables, and there are two types of cursors: implicit cursors and explicit cursors. Implicit cursors are allocated by the SQL server when the user performs DML operations, while explicit cursors are created by users whenever they require them. Explicit cursors are used for fetching data from a table in a row-by-row manner.