當前位置: 首頁>>代碼示例>>Python>>正文


Python gtk.keysyms方法代碼示例

本文整理匯總了Python中gtk.keysyms方法的典型用法代碼示例。如果您正苦於以下問題:Python gtk.keysyms方法的具體用法?Python gtk.keysyms怎麽用?Python gtk.keysyms使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在gtk的用法示例。


在下文中一共展示了gtk.keysyms方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: on_key_press_event

# 需要導入模塊: import gtk [as 別名]
# 或者: from gtk import keysyms [as 別名]
def on_key_press_event(self, widget, event):
        if event.keyval == gtk.keysyms.Left:
            self.x -= self.POS_INCREMENT/self.zoom_ratio
            self.queue_draw()
            return True
        if event.keyval == gtk.keysyms.Right:
            self.x += self.POS_INCREMENT/self.zoom_ratio
            self.queue_draw()
            return True
        if event.keyval == gtk.keysyms.Up:
            self.y -= self.POS_INCREMENT/self.zoom_ratio
            self.queue_draw()
            return True
        if event.keyval == gtk.keysyms.Down:
            self.y += self.POS_INCREMENT/self.zoom_ratio
            self.queue_draw()
            return True
        if event.keyval == gtk.keysyms.Page_Up:
            self.zoom_image(self.zoom_ratio * self.ZOOM_INCREMENT)
            self.queue_draw()
            return True
        if event.keyval == gtk.keysyms.Page_Down:
            self.zoom_image(self.zoom_ratio / self.ZOOM_INCREMENT)
            self.queue_draw()
            return True
        if event.keyval == gtk.keysyms.Escape:
            self.drag_action.abort()
            self.drag_action = NullAction(self)
            return True
        if event.keyval == gtk.keysyms.r:
            self.reload()
            return True
        if event.keyval == gtk.keysyms.q:
            gtk.main_quit()
            return True
        return False 
開發者ID:krintoxi,項目名稱:NoobSec-Toolkit,代碼行數:38,代碼來源:xdot.py

示例2: __init__

# 需要導入模塊: import gtk [as 別名]
# 或者: from gtk import keysyms [as 別名]
def __init__(self, textView):
        self.textView=textView
        self.rkeymap = {}
        self.history = History()
        for name in prefixedMethodNames(self.__class__, "key_"):
            keysymName = name.split("_")[-1]
            self.rkeymap[getattr(gtk.keysyms, keysymName)] = keysymName 
開發者ID:kuri65536,項目名稱:python-for-android,代碼行數:9,代碼來源:gtk2manhole.py

示例3: test_reverseKeymap

# 需要導入模塊: import gtk [as 別名]
# 或者: from gtk import keysyms [as 別名]
def test_reverseKeymap(self):
        """
        Verify that a L{ConsoleInput} has a reverse mapping of the keysym names
        it needs for event handling to their corresponding keysym.
        """
        ci = ConsoleInput(None)
        for eventName in prefixedMethodNames(ConsoleInput, 'key_'):
            keysymName = eventName.split("_")[-1]
            keysymValue = getattr(gtk.keysyms, keysymName)
            self.assertEqual(ci.rkeymap[keysymValue], keysymName) 
開發者ID:kuri65536,項目名稱:python-for-android,代碼行數:12,代碼來源:test_gtk2manhole.py

示例4: __init__

# 需要導入模塊: import gtk [as 別名]
# 或者: from gtk import keysyms [as 別名]
def __init__(self, textView):
        self.textView=textView
        self.rkeymap = {}
        self.history = History()
        for name in dir(gtk.keysyms):
            try:
                self.rkeymap[getattr(gtk.keysyms, name)] = name
            except TypeError:
                pass 
開發者ID:kenorb-contrib,項目名稱:BitTorrent,代碼行數:11,代碼來源:gtk2manhole.py

示例5: on_key_press_event

# 需要導入模塊: import gtk [as 別名]
# 或者: from gtk import keysyms [as 別名]
def on_key_press_event(self, widget, event):
        if event.keyval == gtk.keysyms.Left:
            self.x -= self.POS_INCREMENT/self.zoom_ratio
            self.queue_draw()
            return True
        if event.keyval == gtk.keysyms.Right:
            self.x += self.POS_INCREMENT/self.zoom_ratio
            self.queue_draw()
            return True
        if event.keyval == gtk.keysyms.Up:
            self.y -= self.POS_INCREMENT/self.zoom_ratio
            self.queue_draw()
            return True
        if event.keyval == gtk.keysyms.Down:
            self.y += self.POS_INCREMENT/self.zoom_ratio
            self.queue_draw()
            return True
        if event.keyval in (gtk.keysyms.Page_Up,
                            gtk.keysyms.plus,
                            gtk.keysyms.equal,
                            gtk.keysyms.KP_Add):
            self.zoom_image(self.zoom_ratio * self.ZOOM_INCREMENT)
            self.queue_draw()
            return True
        if event.keyval in (gtk.keysyms.Page_Down,
                            gtk.keysyms.minus,
                            gtk.keysyms.KP_Subtract):
            self.zoom_image(self.zoom_ratio / self.ZOOM_INCREMENT)
            self.queue_draw()
            return True
        if event.keyval == gtk.keysyms.Escape:
            self.drag_action.abort()
            self.drag_action = NullAction(self)
            return True
        if event.keyval == gtk.keysyms.r:
            self.reload()
            return True
        if event.keyval == gtk.keysyms.f:
            win = widget.get_toplevel()
            find_toolitem = win.uimanager.get_widget('/ToolBar/Find')
            textentry = find_toolitem.get_children()
            win.set_focus(textentry[0])
            return True
        if event.keyval == gtk.keysyms.q:
            gtk.main_quit()
            return True
        if event.keyval == gtk.keysyms.p:
            self.on_print()
            return True
        return False 
開發者ID:ym2011,項目名稱:POC-EXP,代碼行數:52,代碼來源:xdot.py


注:本文中的gtk.keysyms方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。