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


Python FigureCanvasBase.key_release_event方法代码示例

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


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

示例1: keyReleaseEvent

# 需要导入模块: from matplotlib.backend_bases import FigureCanvasBase [as 别名]
# 或者: from matplotlib.backend_bases.FigureCanvasBase import key_release_event [as 别名]
 def keyReleaseEvent(self, event):
     key = self._get_key(event)
     if key is None:
         return
     FigureCanvasBase.key_release_event(self, key, guiEvent=event)
     if DEBUG:
         print('key release', key)
开发者ID:Acanthostega,项目名称:matplotlib,代码行数:9,代码来源:backend_qt5.py

示例2: key_release_event

# 需要导入模块: from matplotlib.backend_bases import FigureCanvasBase [as 别名]
# 或者: from matplotlib.backend_bases.FigureCanvasBase import key_release_event [as 别名]
 def key_release_event(self, widget, event):
     if _debug:
         print("FigureCanvasGTK.%s" % fn_name())
     key = self._get_key(event)
     if _debug:
         print("release", key)
     FigureCanvasBase.key_release_event(self, key, guiEvent=event)
     return False  # finish event propagation?
开发者ID:astraw,项目名称:matplotlib,代码行数:10,代码来源:backend_gtk.py

示例3: key_release_event

# 需要导入模块: from matplotlib.backend_bases import FigureCanvasBase [as 别名]
# 或者: from matplotlib.backend_bases.FigureCanvasBase import key_release_event [as 别名]
 def key_release_event(self, widget, event):
     key = self._get_key(event)
     FigureCanvasBase.key_release_event(self, key, guiEvent=event)
     return True  # stop event propagation
开发者ID:jklymak,项目名称:matplotlib,代码行数:6,代码来源:backend_gtk3.py

示例4: key_release

# 需要导入模块: from matplotlib.backend_bases import FigureCanvasBase [as 别名]
# 或者: from matplotlib.backend_bases.FigureCanvasBase import key_release_event [as 别名]
 def key_release(self, event):
     key = self._get_key(event)
     FigureCanvasBase.key_release_event(self, key, guiEvent=event)
开发者ID:astraw,项目名称:matplotlib,代码行数:5,代码来源:backend_tkagg.py

示例5: keyReleaseEvent

# 需要导入模块: from matplotlib.backend_bases import FigureCanvasBase [as 别名]
# 或者: from matplotlib.backend_bases.FigureCanvasBase import key_release_event [as 别名]
 def keyReleaseEvent(self, event):
     key = self._get_key(event)
     if key is not None:
         FigureCanvasBase.key_release_event(self, key, guiEvent=event)
开发者ID:endolith,项目名称:matplotlib,代码行数:6,代码来源:backend_qt5.py

示例6: key_release_event

# 需要导入模块: from matplotlib.backend_bases import FigureCanvasBase [as 别名]
# 或者: from matplotlib.backend_bases.FigureCanvasBase import key_release_event [as 别名]
 def key_release_event(self, widget, event):
     if _debug: print('FigureCanvasGTK3.%s' % fn_name())
     key = self._get_key(event)
     if _debug: print("release", key)
     FigureCanvasBase.key_release_event(self, key, guiEvent=event)
     return True  # stop event propagation
开发者ID:RealGeeks,项目名称:matplotlib,代码行数:8,代码来源:backend_gtk3.py

示例7: handle

# 需要导入模块: from matplotlib.backend_bases import FigureCanvasBase [as 别名]
# 或者: from matplotlib.backend_bases.FigureCanvasBase import key_release_event [as 别名]
    def handle(self, event):
        x=Fltk.Fl.event_x()
        y=Fltk.Fl.event_y()
        yf=self._source.figure.bbox.height - y
        if event == Fltk.FL_FOCUS or event == Fltk.FL_UNFOCUS:
            return 1
        elif event == Fltk.FL_KEYDOWN:
            ikey= Fltk.Fl.event_key()
            if(ikey<=255):
                self._key=chr(ikey)
            else:
                try:
                    self._key=special_key[ikey]
                except:
                    self._key=None
            
            # TODO: Handle ctrl, alt, super modifiers.
            FigureCanvasBase.key_press_event(self._source, self._key)
            return 1
        elif event == Fltk.FL_KEYUP:
            FigureCanvasBase.key_release_event(self._source, self._key)
            self._key=None
        elif event == Fltk.FL_PUSH:
            self.window().make_current()
            if Fltk.Fl.event_button1():
                self._button = 1
            elif  Fltk.Fl.event_button2():
                self._button = 2
            elif  Fltk.Fl.event_button3():
                self._button = 3
            else:
                self._button = None

            if self._draw_overlay:
                self._oldx=x
                self._oldy=y
            if Fltk.Fl.event_clicks():  # according to docs, event_clicks() returns nonzero if this is a double click.
                FigureCanvasBase.button_press_event(self._source, x, yf, self._button, dblclick=True)
                return 1
            else:
                FigureCanvasBase.button_press_event(self._source, x, yf, self._button)
                return 1
        elif event == Fltk.FL_ENTER:
            self.take_focus()
            return 1
        elif event == Fltk.FL_LEAVE:
            return 1
        elif event == Fltk.FL_MOVE:
            FigureCanvasBase.motion_notify_event(self._source, x, yf)
            return 1
        elif event == Fltk.FL_DRAG:
            self.window().make_current()
            if self._draw_overlay:
                self._dx=Fltk.Fl.event_x()-self._oldx
                self._dy=Fltk.Fl.event_y()-self._oldy
                Fltk.fl_overlay_rect(self._oldx,self._oldy,self._dx,self._dy)
            FigureCanvasBase.motion_notify_event(self._source, x, yf)
            return 1
        elif event == Fltk.FL_RELEASE:
            self.window().make_current()
            if self._draw_overlay:
                Fltk.fl_overlay_clear()
            FigureCanvasBase.button_release_event(self._source, x, yf, self._button)
            self._button = None
            return 1
        return 0
开发者ID:jcmdev0,项目名称:matplotlib,代码行数:68,代码来源:backend_fltkagg.py

示例8: _onKeyUp

# 需要导入模块: from matplotlib.backend_bases import FigureCanvasBase [as 别名]
# 或者: from matplotlib.backend_bases.FigureCanvasBase import key_release_event [as 别名]
 def _onKeyUp(self, evt):
     # Override to avoid system chime
     FigureCanvasBase.key_release_event(self, self._get_key(evt), guiEvent=evt)
开发者ID:christianbrodbeck,项目名称:Eelbrain,代码行数:5,代码来源:mpl_canvas.py


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