xdot.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:landport 作者: land-pack 项目源码 文件源码
def is_click(self, event, click_fuzz=4, click_timeout=1.0):
        assert event.type == gtk.gdk.BUTTON_RELEASE
        if self.presstime is None:
            # got a button release without seeing the press?
            return False
        # XXX instead of doing this complicated logic, shouldn't we listen
        # for gtk's clicked event instead?
        deltax = self.pressx - event.x
        deltay = self.pressy - event.y
        return (time.time() < self.presstime + click_timeout
                and math.hypot(deltax, deltay) < click_fuzz)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号