casio1374633

导航

 
else if (0 == strcmp(key,"\x1b")) {
        /* ESC */
        return KEY_ESC;
        
    } else if (0 == strcmp(key,"\x1b[C")) {
        /* cursor right */
        if (pos < len)
        pos++;

    } else if (0 == strcmp(key,"\x1b[D")) {
        /* cursor left */
        if (pos > 0)
        pos--;

    } else if (0 == strcmp(key,"\x1b[1~")) {
        /* home */
        pos = 0;
        
    } else if (0 == strcmp(key,"\x1b[4~")) {
        /* end */
        pos = len;
        
    } else if (0 == strcmp(key,"\x7f")) {

里面有很多键盘的键位.但是不知道这个键位是怎么得来的..百度google都没找到..求达人帮忙了~~

posted on 2013-04-27 20:35  casio1374633  阅读(455)  评论(1编辑  收藏  举报