title: How do I bind the ListBox of a ComboBox in Python Tkinter
body: <p>I am looking to make a bind that allows me to place a certain value depending on the key pressed by the user.
  Here is an example code in which I do it:</p>
  <pre><code>from tkinter import *
  from tkinter import ttk
  
  v=Tk()
  
  combo = ttk.Combobox(values=['item1','item2','item3','item4'], state='readonly')
  combo.current(0)
  combo.pack()
  
  def function(Event):
      if(Event.char in '1234'):
          combo.set(f'item{Event.char}')
  
  combo.bind('&lt;Key&gt;', function)
  v.mainloop()
  </code></pre>
  <p>They will tell me &quot;If that works, what are you doing asking this?&quot;
  Well it turns out that if the Combobox is deployed, the bind stops working.
  How could the problem be solved?</p>
  <hr />
  <p>I know that this part of the question should not be asked, since it has nothing to do with the problem in question. But I would like to ask that if something is wrong in this question, or misspelled, or whatever, be informed. The page of &quot;how to ask a good question&quot; does not serve me, since from my point of view, I do everything as they say there.
  I did my best to make what is written here as detailed and understandable as possible.
  Hope your understanding, thank you.</p>