我们从Python开源项目中,提取了以下3个代码示例,用于说明如何使用wx.WXK_END。
def OnKeyUp(self, event): event.Skip() if not self.selectedNode or not self.hot_map: return if event.KeyCode == wx.WXK_HOME: self.SetSelected(HotMapNavigator.firstNode(self.hot_map)) return elif event.KeyCode == wx.WXK_END: self.SetSelected(HotMapNavigator.lastNode(self.hot_map)) return parent, children, index = HotMapNavigator.findNode(self.hot_map, self.selectedNode) if event.KeyCode == wx.WXK_DOWN: self.SetSelected(HotMapNavigator.nextChild(children, index)) elif event.KeyCode == wx.WXK_UP: self.SetSelected(HotMapNavigator.previousChild(children, index)) elif event.KeyCode == wx.WXK_RIGHT: self.SetSelected(HotMapNavigator.firstChild(children, index)) elif event.KeyCode == wx.WXK_LEFT and parent: self.SetSelected(parent) elif event.KeyCode == wx.WXK_RETURN: wx.PostEvent(self, SquareActivationEvent(node=self.selectedNode, map=self))
def OnKeyUp(self, event): event.Skip() if not self.selectedNode or not self.hot_map: return if event.KeyCode == wx.WXK_HOME: self.SetSelected(HotMapNavigator.firstNode(self.hot_map)) return elif event.KeyCode == wx.WXK_END: self.SetSelected(HotMapNavigator.lastNode(self.hot_map)) return try: parent, children, index = HotMapNavigator.findNode(self.hot_map, self.selectedNode) except TypeError: log.info( 'Unable to find hot-map record for node %s', self.selectedNode ) else: if event.KeyCode == wx.WXK_DOWN: self.SetSelected(HotMapNavigator.nextChild(children, index)) elif event.KeyCode == wx.WXK_UP: self.SetSelected(HotMapNavigator.previousChild(children, index)) elif event.KeyCode == wx.WXK_RIGHT: self.SetSelected(HotMapNavigator.firstChild(children, index)) elif event.KeyCode == wx.WXK_LEFT and parent: self.SetSelected(parent) elif event.KeyCode == wx.WXK_RETURN: wx.PostEvent(self, SquareActivationEvent(node=self.selectedNode, map=self))
def on_keydown_contacts(self,event): keycode=event.GetKeyCode() if keycode==wx.WXK_BACK or keycode==wx.WXK_CANCEL or keycode==wx.WXK_CLEAR or keycode==wx.WXK_DELETE or keycode==wx.WXK_DOWN or keycode==wx.WXK_END or keycode==wx.WXK_LBUTTON : event.Skip() return 0 elif keycode==wx.WXK_NUMPAD_END or keycode==wx.WXK_NUMPAD_NEXT or keycode==wx.WXK_NUMPAD_RIGHT or keycode==wx.WXK_RIGHT or keycode==wx.WXK_LEFT or keycode==wx.WXK_NEXT or keycode==wx.WXK_NUMPAD_DELETE or keycode==wx.WXK_NUMPAD_LEFT: event.Skip() return 0 character=chr(keycode) if character.isdigit() or character==';': event.Skip()