当前位置: 首页>>代码示例>>Python>>正文


Python curses.mousemask方法代码示例

本文整理汇总了Python中curses.mousemask方法的典型用法代码示例。如果您正苦于以下问题:Python curses.mousemask方法的具体用法?Python curses.mousemask怎么用?Python curses.mousemask使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在curses的用法示例。


在下文中一共展示了curses.mousemask方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _screen_set_mousemask

# 需要导入模块: import curses [as 别名]
# 或者: from curses import mousemask [as 别名]
def _screen_set_mousemask(self):
    curses.mousemask(self._mouse_enabled) 
开发者ID:ryfeus,项目名称:lambda-packs,代码行数:4,代码来源:curses_ui.py

示例2: apply

# 需要导入模块: import curses [as 别名]
# 或者: from curses import mousemask [as 别名]
def apply():
    if not sys.platform.startswith('win32'):
        def noop(_):
            pass
        curses.mousemask = noop

    Screen.refresh = ScreenPatch.refresh 
开发者ID:QData,项目名称:deepWordBug,代码行数:9,代码来源:overrides.py

示例3: __remove_argument_call_main

# 需要导入模块: import curses [as 别名]
# 或者: from curses import mousemask [as 别名]
def __remove_argument_call_main(self, screen, enable_mouse=True):
        # screen disgarded.
        if enable_mouse:
            curses.mousemask(curses.ALL_MOUSE_EVENTS)
        del screen
        return self.main() 
开发者ID:hexway,项目名称:apple_bleee,代码行数:8,代码来源:apNPSApplication.py

示例4: init_screen

# 需要导入模块: import curses [as 别名]
# 或者: from curses import mousemask [as 别名]
def init_screen():
    curses.start_color() # load colors
    curses.use_default_colors()
    curses.noecho()      # do not echo text
    curses.cbreak()      # do not wait for "enter"
    curses.mousemask(curses.ALL_MOUSE_EVENTS)

    # Hide cursor, if terminal AND curse supports it
    if hasattr(curses, 'curs_set'):
        try:
            curses.curs_set(0)
        except:
            pass 
开发者ID:yadutaf,项目名称:ctop,代码行数:15,代码来源:cgroup_top.py

示例5: main

# 需要导入模块: import curses [as 别名]
# 或者: from curses import mousemask [as 别名]
def main(screen):
    c.curs_set(0)
    c.mousemask(1)

    inp = screen.getch()
    if inp == c.KEY_MOUSE:
        screen.addstr(17, 40, "Mouse is clicked")
        screen.refresh()

    screen.getch()
    time.sleep(10) 
开发者ID:PacktPublishing,项目名称:Learning-Python-by-building-games,代码行数:13,代码来源:mouse_events.py

示例6: set_mouse_tracking

# 需要导入模块: import curses [as 别名]
# 或者: from curses import mousemask [as 别名]
def set_mouse_tracking(self, enable=True):
        """
        Enable mouse tracking.

        After calling this function get_input will include mouse
        click events along with keystrokes.
        """
        enable = bool(enable)
        if enable == self._mouse_tracking_enabled:
            return

        if enable:
            curses.mousemask(0
                | curses.BUTTON1_PRESSED | curses.BUTTON1_RELEASED
                | curses.BUTTON2_PRESSED | curses.BUTTON2_RELEASED
                | curses.BUTTON3_PRESSED | curses.BUTTON3_RELEASED
                | curses.BUTTON4_PRESSED | curses.BUTTON4_RELEASED
                | curses.BUTTON1_DOUBLE_CLICKED | curses.BUTTON1_TRIPLE_CLICKED
                | curses.BUTTON2_DOUBLE_CLICKED | curses.BUTTON2_TRIPLE_CLICKED
                | curses.BUTTON3_DOUBLE_CLICKED | curses.BUTTON3_TRIPLE_CLICKED
                | curses.BUTTON4_DOUBLE_CLICKED | curses.BUTTON4_TRIPLE_CLICKED
                | curses.BUTTON_SHIFT | curses.BUTTON_ALT
                | curses.BUTTON_CTRL)
        else:
            raise NotImplementedError()

        self._mouse_tracking_enabled = enable 
开发者ID:AnyMesh,项目名称:anyMesh-Python,代码行数:29,代码来源:curses_display.py

示例7: __init__

# 需要导入模块: import curses [as 别名]
# 或者: from curses import mousemask [as 别名]
def __init__(self, uncertainty=False):
        super(Screen, self).__init__()
        self.screen = curses.initscr()
        curses.noecho()
        curses.mousemask(1)
        self.screen.keypad(True)
        self.y = 3
        self.x = 1
        self.offset = 0
        self.acs = {}
        self.lock_icao = None

        self.columns = COLUMNS
        if uncertainty:
            self.columns.extend(UNCERTAINTY_COLUMNS) 
开发者ID:junzis,项目名称:pyModeS,代码行数:17,代码来源:screen.py

示例8: init_curses

# 需要导入模块: import curses [as 别名]
# 或者: from curses import mousemask [as 别名]
def init_curses(self):
        os.environ.setdefault('ESCDELAY', '25')
        self.stdscr = curses.initscr()
        self.stdscr.clear()
        curses.noecho()
        curses.curs_set(0) 
        curses.mousemask(curses.REPORT_MOUSE_POSITION
            | curses.BUTTON1_PRESSED | curses.BUTTON1_RELEASED
            | curses.BUTTON2_PRESSED | curses.BUTTON2_RELEASED
            | curses.BUTTON3_PRESSED | curses.BUTTON3_RELEASED
            | curses.BUTTON4_PRESSED | curses.BUTTON4_RELEASED
            | curses.BUTTON1_CLICKED | curses.BUTTON3_CLICKED
            | curses.BUTTON1_DOUBLE_CLICKED 
            | curses.BUTTON1_TRIPLE_CLICKED
            | curses.BUTTON2_DOUBLE_CLICKED 
            | curses.BUTTON2_TRIPLE_CLICKED
            | curses.BUTTON3_DOUBLE_CLICKED 
            | curses.BUTTON3_TRIPLE_CLICKED
            | curses.BUTTON4_DOUBLE_CLICKED 
            | curses.BUTTON4_TRIPLE_CLICKED
            | curses.BUTTON_SHIFT | curses.BUTTON_ALT
            | curses.BUTTON_CTRL)
        self.stdscr.keypad(True) # Handle our own escape codes for now

        # The first call to getch seems to clobber the statusbar.
        # So we make a dummy first call.
        self.stdscr.nodelay(True)
        self.stdscr.getch()
        self.stdscr.nodelay(False) 
开发者ID:dsanson,项目名称:termpdf.py,代码行数:31,代码来源:termpdf.py

示例9: setup_mouse

# 需要导入模块: import curses [as 别名]
# 或者: from curses import mousemask [as 别名]
def setup_mouse(self):
        # Mouse support
        curses.mouseinterval(10)
        if self.app.config["editor"]["use_mouse"]:
            curses.mousemask(-1)  # All events
        else:
            curses.mousemask(0)  # All events 
开发者ID:richrd,项目名称:suplemon,代码行数:9,代码来源:ui.py

示例10: setUpCurses

# 需要导入模块: import curses [as 别名]
# 或者: from curses import mousemask [as 别名]
def setUpCurses(self, cursesScreen):
        self.cursesScreen = cursesScreen
        curses.mousemask(-1)
        curses.mouseinterval(0)
        # Enable mouse tracking in xterm.
        sys.stdout.write('\033[?1002;h')
        #sys.stdout.write('\033[?1005;h')
        curses.meta(1)
        # Access ^c before shell does.
        curses.raw()
        # Enable Bracketed Paste Mode.
        sys.stdout.write('\033[?2004;h')
        # Push the escape codes out to the terminal. (Whether this is needed
        # seems to vary by platform).
        sys.stdout.flush()
        try:
            curses.start_color()
            if not curses.has_colors():
                userMessage("This terminal does not support color.")
                self.quitNow()
            else:
                curses.use_default_colors()
        except curses.error as e:
            app.log.error(e)
        app.log.startup(u"curses.COLORS", curses.COLORS)
        if 0:
            assert curses.COLORS == 256
            assert curses.can_change_color() == 1
            assert curses.has_colors() == 1
            app.log.detail("color_content:")
            for i in range(0, curses.COLORS):
                app.log.detail("color", i, ": ", curses.color_content(i))
            for i in range(16, curses.COLORS):
                curses.init_color(i, 500, 500, i * 787 % 1000)
            app.log.detail("color_content, after:")
            for i in range(0, curses.COLORS):
                app.log.detail("color", i, ": ", curses.color_content(i))
        if 1:
            #rows, cols = self.cursesScreen.getmaxyx()
            cursesWindow = self.cursesScreen
            cursesWindow.leaveok(1)  # Don't update cursor position.
            cursesWindow.scrollok(0)
            cursesWindow.timeout(10)
            cursesWindow.keypad(1)
            app.window.mainCursesWindow = cursesWindow 
开发者ID:google,项目名称:ci_edit,代码行数:47,代码来源:ci_program.py


注:本文中的curses.mousemask方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。