Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/c/69.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/amazon-s3/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C诅咒不';抓不到鼠标事件_C_Mouseevent_Ncurses_Curses - Fatal编程技术网

C诅咒不';抓不到鼠标事件

C诅咒不';抓不到鼠标事件,c,mouseevent,ncurses,curses,C,Mouseevent,Ncurses,Curses,我正试图在诅咒程序中实现上下滚动,目前我正试图捕捉事件并显示其编号: MEVENT event; mousemask(ALL_MOUSE_EVENTS, NULL); while (ch != 126) { ch=wgetch (current->child); switch(ch) { case KEY_MOUSE: if(getmouse(&event) == OK) wprintw (current->child,

我正试图在诅咒程序中实现上下滚动,目前我正试图捕捉事件并显示其编号:

MEVENT event;
mousemask(ALL_MOUSE_EVENTS, NULL);

while (ch != 126)
{
  ch=wgetch (current->child);
  switch(ch)
  {
    case KEY_MOUSE:
      if(getmouse(&event) == OK)
          wprintw (current->child, "\nmouse event: %d\n", event.bstate);
      break;
    default:
          wprintw (current->child, "key: %d\n", ch);
  }
  wrefresh (current->child );
}
has_mouse()
返回
1
,但是没有捕捉到事件,没有单击,没有鼠标滚轮


另外,我使用的是
ncurses 6.0.4
,因此应该支持鼠标滚轮。

缺乏捕捉滚轮鼠标的能力听起来像是ncurse5应用程序。该功能适用于xterm(以及实现xterm风格鼠标控件的程序)。问题中没有足够的信息来猜测是哪种类型的问题阻止您查看鼠标事件


没有“ncurses 6.0.4”这样的东西。ncurses版本有主要、次要和修补日期。目前,最新的开发版本是

缺乏捕获滚轮鼠标的能力,听起来像是一个ncurse5应用程序。该功能适用于xterm(以及实现xterm风格鼠标控件的程序)。问题中没有足够的信息来猜测是哪种类型的问题阻止您查看鼠标事件


没有“ncurses 6.0.4”这样的东西。ncurses版本有主要、次要和修补日期。目前,最新的开发版本是linux。我只是在另一次搜索后发现了一个帖子!它需要
键盘
设置为
。现在它起作用了。仍然缺少一件事,我能够在按下按钮4时捕捉到鼠标向上滚动,但在任何按钮事件中都不会捕捉到向下滚动(我在一个大的
if
/
else if
)中尝试了它们。不,是linux。我只是在另一次搜索后发现了一个帖子!它需要
键盘
设置为
。现在它起作用了。仍然缺少一件事,我能够在按下按钮4时捕捉到鼠标向上滚动,但在任何按钮事件中都不会捕捉到向下滚动(我在一个大的
if
/
else if
中尝试所有这些)。