ncurses on windows, can't receive KEY_MOUSE
Demosthenes Koptsis <[email protected]> Sat, 6 Apr 2024 23:58:15 +0300
| Newsgroups | gmane.comp.lib.ncurses.general |
|---|---|
| Message-ID | <[email protected]> |
This is a multi-part message in MIME format.
--------------iUE7OTr7CYx0o5KJGXbyqFaL
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Hello,
i can't make mouse clicks work with ncurses on Windows 11.
It doesn't detect KEY_MOUSE, but 'q' quits just fine
===================== code ==========================
#include <ncurses.h>
int main()
{
initscr();
cbreak();
keypad(stdscr, TRUE);
mousemask( ALL_MOUSE_EVENTS, NULL);
move(10,30);
printw("Hello ncurses!\n");
refresh();
while(true) {
int c = getch();
if (c == 'q') break;
if (c == KEY_MOUSE) break;
}
endwin();
return 0;
}
======================================================
I use Msys2 mingw64 gcc and
ncurses version 6.4.20231217-1
https://packages.msys2.org/base/mingw-w64-ncurses
<https://packages.msys2.org/base/mingw-w64-ncurses>
I tried the cmd terminal from Win11 and Msys2 mingw64 terminal, but
neither of them accept mouse clicks.
Is this a bug of ncurses ?
Thanks, DimK
--------------iUE7OTr7CYx0o5KJGXbyqFaL
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 8bit
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Hello,</p>
<p>i can't make mouse clicks work with ncurses on Windows 11.</p>
<p> It doesn't detect KEY_MOUSE, but 'q' quits just fine</p>
<p>===================== code ==========================</p>
<p>#include <ncurses.h><br>
<br>
int main()<br>
{<br>
initscr();<br>
cbreak();<br>
<br>
keypad(stdscr, TRUE);<br>
mousemask( ALL_MOUSE_EVENTS, NULL);<br>
<br>
<br>
move(10,30);<br>
printw("Hello ncurses!\n");<br>
refresh();<br>
<br>
while(true) {<br>
int c = getch();<br>
if (c == 'q') break;<br>
if (c == KEY_MOUSE) break;<br>
}<br>
<br>
endwin();<br>
return 0;<br>
}<br>
======================================================</p>
<p>I use Msys2 mingw64 gcc and </p>
<p>ncurses version <span
style="color: rgb(222, 226, 230); font-family: Roboto, sans-serif; font-size: 15px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(33, 37, 41); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;">6.4.20231217-1
<br>
</span></p>
<p><span
style="color: rgb(222, 226, 230); font-family: Roboto, sans-serif; font-size: 15px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(33, 37, 41); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;"><a
href="https://packages.msys2.org/base/mingw-w64-ncurses">https://packages.msys2.org/base/mingw-w64-ncurses<br>
</a></span></p>
<p>I tried the cmd terminal from Win11 and Msys2 mingw64 terminal,
but neither of them accept mouse clicks.</p>
<p>Is this a bug of ncurses ?</p>
<p>Thanks, DimK<br>
</p>
<p> <br>
</p>
</body>
</html>
--------------iUE7OTr7CYx0o5KJGXbyqFaL--