console: add to line movement helpers
Add two helpers to move to the end or home of the current line. Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This commit is contained in:
parent
f85244ead9
commit
f0bcc37cee
@ -402,6 +402,22 @@ void kmscon_console_move_right(struct kmscon_console *con, unsigned int num)
|
||||
con->cursor_x += num;
|
||||
}
|
||||
|
||||
void kmscon_console_move_line_end(struct kmscon_console *con)
|
||||
{
|
||||
if (!con)
|
||||
return;
|
||||
|
||||
con->cursor_x = con->cells_x - 1;
|
||||
}
|
||||
|
||||
void kmscon_console_move_line_home(struct kmscon_console *con)
|
||||
{
|
||||
if (!con)
|
||||
return;
|
||||
|
||||
con->cursor_x = 0;
|
||||
}
|
||||
|
||||
void kmscon_console_erase_cursor_to_end(struct kmscon_console *con)
|
||||
{
|
||||
if (!con)
|
||||
|
@ -99,6 +99,8 @@ void kmscon_console_move_down(struct kmscon_console *con, unsigned int num,
|
||||
bool scroll);
|
||||
void kmscon_console_move_left(struct kmscon_console *con, unsigned int num);
|
||||
void kmscon_console_move_right(struct kmscon_console *con, unsigned int num);
|
||||
void kmscon_console_move_line_end(struct kmscon_console *con);
|
||||
void kmscon_console_move_line_home(struct kmscon_console *con);
|
||||
void kmscon_console_erase_cursor_to_end(struct kmscon_console *con);
|
||||
void kmscon_console_erase_home_to_cursor(struct kmscon_console *con);
|
||||
void kmscon_console_erase_current_line(struct kmscon_console *con);
|
||||
|
Loading…
x
Reference in New Issue
Block a user