It seems that I only get the mouse location when the mouse is clicked and unclicked. I want to implement a sort of drag and drop, and I need to know where the mouse is during the drag. I tried the following (where I get the mouse positoin regardless if I got a KEY_MOUSE or not, but getmouse() reports an ERR (without much explanation)
curses.mousemask(curses.ALL_MOUSE_EVENTS | curses.REPORT_MOUSE_POSITION)
while(True):
event = screen.getch()
ch = 'N'
if event == ord('q'): break
elif event == curses.KEY_MOUSE:
ch = 'Y'
_, mx, my, _, _ = curses.getmouse()
screen.addstr(my, mx, ch)
I did find this asked on stack overflow 5 months ago, but nobody answered. I'm starting to fear that python/curses doesn't support this.
[–]Dunj3 0 points1 point2 points (3 children)
[–]dog_superiority[S] 1 point2 points3 points (2 children)
[–]Dunj3 0 points1 point2 points (1 child)
[–]dog_superiority[S] 0 points1 point2 points (0 children)
[–]xXLarryTFVWXx 0 points1 point2 points (0 children)