title: Python control amount of pixel movement in tkinter
body: <pre><code>posshift = 1
  def scrollimage(event):
      if event.keysym =='Up':
              posshift = posshift + 1
      elif event.keysym == 'Down':
              posshift = posshift - 1
      elif event.keysym =='Left':
              canvas_1.move(ALL,15,0)
      elif event.keysym =='Right':
              canvas_1.move(ALL,-15,0)
  </code></pre>
  
  <p>In the following code I'm trying to get the graphics on the screen to move a certain distance left or right.  That works correctly.  What I would like to get to happen is to have it so when I hit the Up arrow it increases the amount of movement(15 becomes 16, 17, 18, 19) on both the left and right and when I hit the Down arrow key it decreases the amount of movement(15 becomes 14, 13, 12, 11).  When I change the ALL, 15, 0 to ALL, posshift, 0 all I get is an error along the lines that posshift is being incremented before it's been created.  I have posshift created right after the import statements before the function is ever created.  What do I have to do to be able to increase/decrease the value of the movement when I press the Left/Right arrow keys.  I'm not on Linux right now, where I have python installed so I can't give the exact error that comes up...I do remember the first part of the error line said Unbound...if that helps.</p>
  
  <p>Also in a very similar question...I fess I haven't tried this yet, it didn't hit me until I went to bed last night and I haven't been back on the computer until now so I figure I will ask first, worry later.  How do I reference the PageUp, PageDown, Home, End keys.  I'm going to want them for separate ideas as well in this program, quite soon, like probably tonight.  I know I will probably have to reference them both in the function as well as canvas.bind_all.</p>