def get_mouse(self, screen):
try:
id, x, y, z, bstate = curses.getmouse()
screen_y, screen_x, clip_h, clip_w = self.clip_size()
y -= screen_y
x -= screen_x
# Ignore clicks outside clipped screen
if y < clip_h and x < clip_w:
return self.mouse_target(screen, y, x)
except curses.error:
pass
评论列表
文章目录