2 curses library IO processing-cursor operation

Source: Internet
Author: User

2.5 cursor operation

==================


2.5.1 cursor description

---------------

* In the curses library, the cursor is divided into the physical cursor and the logical cursor. The physical cursor has only one, while the logical cursor belongs to the curses window. Each window has only one physical cursor, but may have multiple logical curses.

* The physical cursor position will change after processing the input function, but you can use the _ leave flag in the WINDOW structure to locate it again.

* If the _ leave flag is set, after the input is complete, the logical cursor moves to the last written area in the window pointed by the physical cursor.

* If the _ leave flag is not set, after the input operation is complete, the physical cursor will return to the location where the logical cursor points to the window

* _ Leave flag controlled by leaveok () function


2.5.2 cursor movement function

-------------------

/** @ Brief move the logic cursor to the specified position @ param x coordinate, indicating the number of rows in the position after moving @ param y coordinate, number of columns in the moving position */int move (int x, int y ); /** @ brief move the physical cursor to the specified position @ param last_x move the row position where the cursor is located @ param last_y move the column position where the cursor is located @ param new_x move the row where the cursor is located position @ param new_y the position of the cursor column after moving @ note mvcur () it takes effect immediately without waiting for screen refresh */void mvcur (int last_x, int last_y, int new_x, int new_y ); /** @ brief set the state of the physical cursor @ param visibility the state of the physical cursor 0 hide 1 normal 2 highlighted */int curs_set (int visiblility)


This article is from the "dark day" blog, please be sure to keep this source http://darksun.blog.51cto.com/3874064/1286703

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.