[ Previous | Next | Table of Contents | Index | Library Home | Legal | Search ]

Technical Reference: Base Operating System and Extensions , Volume 2


inch, mvinch, mvwinch, or winch Subroutine

Purpose

Inputs a single-byte character and rendition from a window.

Library

Curses Library (libcurses.a)

Syntax

#include <curses.h>

chtype inch(void);

chtype mvinch(int y,
int x);


chtype mvwinch(WINDOW *win,
int y,
int x);

chtype winch(WINDOW *win);

Description

The inch, winch, mvinch, and mvwinch subroutines return the character and rendition, of type chtype, at the current or specified position in the current or specified window.

Parameters


*win Specifies the window from which to get the character.
x  
y  

Return Values

Upon successful completion, these subroutines return the specified character and rendition. Otherwise, they return (chtype) ERR.

Examples

  1. To get the character at the current cursor location in the stdscr, enter:

    chtype character;
     
    character = inch();
    
  2. To get the character at the current cursor location in the user-defined window my_window, enter:

    WINDOW *my_window;
    chtype character;
     
    character = winch(my_window);
    
  3. To move the cursor to the coordinates y = 0, x = 5 and then get that character, enter:

    chtype character;
     
    character = mvinch(0, 5);
    
  4. To move the cursor to the coordinates y = 0, x = 5 in the user-defined window my_window and then get that character, enter:

    WINDOW *my_window;
    chtype character;
     
    character = mvwinch(my_window, 0, 5);
    

Implementation Specifics

These subroutines are part of Base Operating System (BOS).

Related Information

Curses Overview for Programming in AIX 5L Version 5.1 General Programming Concepts: Writing and Debugging Programs.

List of Curses Subroutines in AIX 5L Version 5.1 General Programming Concepts: Writing and Debugging Programs.

Manipulating Characters with Curses in AIX 5L Version 5.1 General Programming Concepts: Writing and Debugging Programs.


[ Previous | Next | Table of Contents | Index | Library Home | Legal | Search ]