找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 361|回复: 1

[求助]:关于判断键盘输入问题

[复制链接]
发表于 2005-9-24 15:28:39 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?立即注册

×
我想在CAD命令行中实现如下功能:选择参数:半径(R),直径(D):,如果键盘输入的是R就实现半径的功能,如果键盘输入的是D,就实现直径功能。我是这样实现的,
char input[10];
acedGetKword(“选择参数:半径(R),直径(D)”,input);
if(strcmp(input,"R") == 0)
{};
if(strcmp(input,"D")==0)
{};
但是我怎么输入R,D都没有反映,都说是无效的输入?
不知道我哪里有问题,要怎么样才能实现这个功能?
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
发表于 2005-9-24 16:00:03 | 显示全部楼层
int

acedGetKword(

const char * prompt,

char * result);

prompt Optional prompt string that acedGetKword() displays before it pauses, or null for no prompt
result Pointer to the result buffer that holds the entered keyword (maximum 131 characters)

Gets user input for a keyword.

The AutoCAD user can enter the keyword from the keyboard. The list of keywords that acedGetKword() accepts is set by a prior call to acedInitGet(). If the user enters a string not specified in the call to acedInitGet(), AutoCAD displays an error message and tries again (and redisplays prompt, if one was specified). If the user types only [Return], acedGetKword() returns an empty string ("") unless the call to acedInitGet() also disallowed null input.

The user cannot respond to acedGetKword() by entering an AutoLISP expression.

The acedGetKword() function does not return RTKWORD. The RTKWORD value is used only as a status (or error) code that is returned by other user-input (acedGetXxx()) functions such as acedGetInt().

The acedGetKword() function returns one of the following: RTNORM if it succeeds, RTERROR if it fails, or RTCAN if the user cancels the request (by entering [Ctrl]+[C]). It returns RTMODELESS, if the active command was registered using the ACRX_CMD_INTERRUPTIBLE flag and the document has received a modeless interrupt signal from a call to AcApDocManager::sendModelessInterrupt(). The prior call to acedInitGet() can also enable a return value of RTNONE (if the user enters a null response or arbitrary input).

Include File
acedads.h
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|申请友链|Archiver|手机版|小黑屋|辽公网安备|晓东CAD家园 ( 辽ICP备15016793号 )

GMT+8, 2024-11-17 00:52 , Processed in 0.350418 second(s), 33 queries , Gzip On.

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表