如何检测方向键为$ P $ Linux或Solaris下用C pssed? [英] How to detect that arrow key is pressed using C under Linux or Solaris?

查看:136
本文介绍了如何检测方向键为$ P $ Linux或Solaris下用C pssed?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是在方向键一个C程序来检测的最好办法是在Linux或Solaris下pssed $ P $?

What is the best way to detect in a C program that arrow key is pressed under Linux or Solaris?

据我所知是没有标准的C函数,可以做到这一点。
我不希望使用INT86函数。我需要做的是在一个便携的方式。

As I know there is no standard C function that can do it. I don't want to use int86 function. I need to do it in a portable way.

修改:我问的控制台应用程序。

Edit: I am asking about console applications.

推荐答案

您应该看看诅咒/ ncurses库,这将给你先进的屏幕和键盘操作的控制台应用程序。

You should look at the curses/ncurses library which will give you advanced screen and keyboard handling for console applications.

有很多文档可供诅咒,这是一个丰富的图书馆

There is a lot of documentation available for curses, which is an extensive library.

有上过这个问题写了可用的这里

There is a write-up on this very question available here

这篇关于如何检测方向键为$ P $ Linux或Solaris下用C pssed?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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