title: How to get tk <<ListboxSelect>> event from keyboard scroll
body: <p>Does anyone know of a way to have a tk.listbox selection change AS I scroll up and down with the up/down keyboard keys? </p>
  
  <p>At present I get an event from a Mouse click.</p>
  
  <p>But if I scroll to the list entry with the up/down keys I don't get an event until AFTER i hit the spacebar.</p>
  
  <p>What I would like is for curselection() to change automatically as I scroll without having to commit with the spacebar. I want to eliminate the need for the spacebar by having the listbox selection change with each up or down key press.</p>
  
  <pre><code>from tkinter import *
  from tkinter import messagebox
  
  def onlbclick(evt):
      w=evt.widget
      index = int(w.curselection()[0])
      value=w.get(index)
      messagebox.showinfo("Listbox Select",'You selected listitem %d: "%s"',  % (index, value))
  
  
  
  root =  Tk()
  root.geometry("200x200")
  root.title("List Box Test")
  fr = Frame(root, width=200, height=200,bg="grey")
  fr.pack()
  
  lb=Listbox(fr,selectmode="SINGLE",bg="white")
  lb.insert(1,"blah")
  lb.insert(2,"blah blah")
  lb.insert(3, "blah blah blah")
  lb.insert(4, "blah blah blah blah")
  lb.grid(row=1, rowspan=10, column=0,columnspan=5, sticky='W', /
  padx=5, pady=5,ipadx=5, ipady=5)
  lb.bind('&lt;&lt;ListboxSelect&gt;&gt;', onlbclick)
  
  root.mainloop()
  </code></pre>
  
  <p>Here's a short sample version to demonstrate the issue. 
  Run the code. Click any item in the list box and you get a messagebox with the text of the list item you clicked.  Now without using the mouse, use the up or down arrow keys on the keyboard and scroll through the list. In order to trigger a selection change event you must press the spacebar. </p>