本文整理汇总了Python中curses.REPORT_MOUSE_POSITION属性的典型用法代码示例。如果您正苦于以下问题:Python curses.REPORT_MOUSE_POSITION属性的具体用法?Python curses.REPORT_MOUSE_POSITION怎么用?Python curses.REPORT_MOUSE_POSITION使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类curses
的用法示例。
在下文中一共展示了curses.REPORT_MOUSE_POSITION属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_mouse_scroll
# 需要导入模块: import curses [as 别名]
# 或者: from curses import REPORT_MOUSE_POSITION [as 别名]
def test_mouse_scroll(self):
#self.setMovieMode(True)
dirList = [
u"./ ", u"../ ", u"._ A name with cr\\r/",
]
self.runWithFakeInputs([
self.displayCheck(0, 0, [u" ci "]),
self.displayCheck(2, 7, [u" "]), CTRL_O,
self.displayCheck(0, 0, [u" ci Open File "]), CTRL_A,
self.writeText(self.pathToSample(u"")),
self.displayCheck(3, 0, dirList[0:3]),
self.mouseEvent(0, 5, 0, curses.REPORT_MOUSE_POSITION),
self.displayCheck(3, 0, dirList[0:3]),
self.mouseEvent(1, 5, 0, curses.REPORT_MOUSE_POSITION),
self.displayCheck(3, 0, dirList[1:3]),
self.mouseEvent(2, 5, 0, curses.REPORT_MOUSE_POSITION),
self.displayCheck(3, 0, dirList[2:3]),
self.mouseEvent(0, 5, 0, curses.BUTTON4_PRESSED),
self.displayCheck(3, 0, dirList[1:3]),
self.mouseEvent(1, 5, 0, curses.BUTTON4_PRESSED),
self.displayCheck(3, 0, dirList[0:3]),
self.mouseEvent(2, 5, 0, curses.BUTTON4_PRESSED),
self.displayCheck(3, 0, dirList[0:3]),
CTRL_Q, CTRL_Q
])
示例2: mouseButtonName
# 需要导入模块: import curses [as 别名]
# 或者: from curses import REPORT_MOUSE_POSITION [as 别名]
def mouseButtonName(buttonState):
"""Curses debugging. Prints readable name for state of mouse buttons."""
result = u""
if buttonState & curses.BUTTON1_RELEASED:
result += u'BUTTON1_RELEASED'
if buttonState & curses.BUTTON1_PRESSED:
result += u'BUTTON1_PRESSED'
if buttonState & curses.BUTTON1_CLICKED:
result += u'BUTTON1_CLICKED'
if buttonState & curses.BUTTON1_DOUBLE_CLICKED:
result += u'BUTTON1_DOUBLE_CLICKED'
if buttonState & curses.BUTTON2_RELEASED:
result += u'BUTTON2_RELEASED'
if buttonState & curses.BUTTON2_PRESSED:
result += u'BUTTON2_PRESSED'
if buttonState & curses.BUTTON2_CLICKED:
result += u'BUTTON2_CLICKED'
if buttonState & curses.BUTTON2_DOUBLE_CLICKED:
result += u'BUTTON2_DOUBLE_CLICKED'
if buttonState & curses.BUTTON3_RELEASED:
result += u'BUTTON3_RELEASED'
if buttonState & curses.BUTTON3_PRESSED:
result += u'BUTTON3_PRESSED'
if buttonState & curses.BUTTON3_CLICKED:
result += u'BUTTON3_CLICKED'
if buttonState & curses.BUTTON3_DOUBLE_CLICKED:
result += u'BUTTON3_DOUBLE_CLICKED'
if buttonState & curses.BUTTON4_RELEASED:
result += u'BUTTON4_RELEASED'
if buttonState & curses.BUTTON4_PRESSED:
result += u'BUTTON4_PRESSED'
if buttonState & curses.BUTTON4_CLICKED:
result += u'BUTTON4_CLICKED'
if buttonState & curses.BUTTON4_DOUBLE_CLICKED:
result += u'BUTTON4_DOUBLE_CLICKED'
if buttonState & curses.REPORT_MOUSE_POSITION:
result += u'REPORT_MOUSE_POSITION'
if buttonState & curses.BUTTON_SHIFT:
result += u' SHIFT'
if buttonState & curses.BUTTON_CTRL:
result += u' CTRL'
if buttonState & curses.BUTTON_ALT:
result += u' ALT'
return result