bug-ncurses
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: C++ Mouse-click listener in headless Ubuntu (Ubuntu Server Edition)


From: Thomas Dickey
Subject: Re: C++ Mouse-click listener in headless Ubuntu (Ubuntu Server Edition)
Date: Mon, 12 Nov 2012 20:09:18 -0500
User-agent: Mutt/1.5.20 (2009-06-14)

On Mon, Nov 12, 2012 at 07:19:12AM -0800, dinamex wrote:
> 
> I want to solve a pretty easy problem. I just want to detect a mouse click
> under Ubuntu Server(without GUI respectively windows management). Therefore,
> I use Ncurses and following code snippet, but it doesn't detect any mouse
> actions. I looked up the web for 2 days now without success. would be great
> to get your help.

mouse events are treated as a function-key.

man mousemask:

       Mouse  events  under  xterm  will not be detected correctly in a window
       with its keypad bit off, since they are interpreted  as  a  variety  of
       function  key.   Your  terminfo  description  should  have kmous set to
       "\E[M" (the beginning of the response from  xterm  for  mouse  clicks).
       Other  values  for  kmous are permitted, but under the same assumption,
       i.e., it is the beginning of the response.

that is:

keypad(stdscr, TRUE);

-- 
Thomas E. Dickey <address@hidden>
http://invisible-island.net
ftp://invisible-island.net

Attachment: signature.asc
Description: Digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]