python - Tkinter Prior key giving error -
def keypress(self,event): if event.keysym in self.keys: # event type 2 key down, type 3 key self.keys[event.keysym] = event.type == '2' def looper(self): if self.keys['up']: self.canvas.yview_scroll(-2,'units') if self.keys['down']: self.canvas.yview_scroll(2,'units') if self.keys['left']: self.canvas.xview_scroll(-2,'units') if self.keys['right']: self.canvas.xview_scroll(2,'units') if self.keys['prior']: p = p -.01 self.draw() if self.keys['next']: p = p +.01 self.draw()
when run program comes error keyerror: prior. want recognize when press pageup/down keys can zoom in/out. without prior/next runs fine , operates should when press up/down/left/right cursor keys.
Comments
Post a Comment