诅咒越来越箭头键 [英] Curses getting arrow keys

查看:233
本文介绍了诅咒越来越箭头键的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在试图获得通过诅咒(ncurses的)从方向键的输入也不会捕捉尽可能KEY_UP等我用键盘功能与真正的说法,但仍残培返回逃脱序列。我如何通过函数getch(返回的值筛选),并专门抢箭头键?

In trying to get input from the arrow keys via curses (ncurses) it won't catch as KEY_UP etc. I used the keypad function with a true argument but getch still returns an escaped sequence. How do I sift through the values returned by getch() and grab the arrow keys specifically?

推荐答案

我是存储残培()呼吁为char的,当他们被认为是int的。在开关后完美的作品。

I was storing getch() calls as char's when they were supposed to be int's. Works perfectly after the switch.

这篇关于诅咒越来越箭头键的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆