Home>

On Raspberry Pi,andalso respond when scrolling the mouse wheel. Is that the specification?

import tkinter as tk
def func (e, str):
    print (str)
win = tk.Tk ()
win.geometry ("400x300")
entry = tk.Entry (win)
entry.grid ()
entry.focus_set ()
entry.bind ("<Button>", lambda e: func (e, "<Button>")) # When pressed with each click (scroll?)
# entry.bind ("<ButtonPress>", lambda e: func (e, "<ButtonPress>")) Same as #<Button>
# entry.bind ("<Button-1>", lambda e: func (e, "<Button-1>")) # When pressed by left click
# entry.bind ("<Button-2>", lambda e: func (e, "<Button-2>")) # When pressed with a middle click
# entry.bind ("<Button-3>", lambda e: func (e, "<Button-3>")) # When right-clicked
# entry.bind ("<ButtonRelease>", lambda e: func (e, "<ButtonRelease>")) # When released by each click (scroll?)
# entry.bind ("<Double-1>", lambda e: func (e, "<Double-1>")) # Left double click
# entry.bind ("<Triple-1>", lambda e: func (e, "<Triple-1>")) # When pressed with a left triple click
# entry.bind ("<Motion>", lambda e: func (e, "<Motion>")) #When the mouse pointer moves
# entry.bind ("<Enter>", lambda e: func (e, "<Enter>")) #Enter the mouse pointer widget
# entry.bind ("<Leave>", lambda e: func (e, "<Leave>")) # Exit from mouse pointer widget
# entry.bind ("<MouseWheel>", lambda e: func (e, "<MouseWheel>")) #When you use the mouse wheel
# entry.bind ("<Key>", lambda e: func (e, "<Key>")) When you press the # key
# entry.bind ("<KeyRelease>", lambda e: func (e, "<KeyRelease>")) # When you release the key (does it react even if you hold it down?)
# entry.bind ("<Escape>", lambda e: func (e, "<Escape>")) # When you press the'Esc'key
# entry.bind ("<Tab>", lambda e: func ("<Tab>")) # When you press the'Tab'key
# entry.bind ("<Return>", lambda e: func (e, "<Return>")) # When you press the'Enter'key
# entry.bind ("<BackSpace>", lambda e: func (e, "<BackSpace>")) # When you press the'Backspace' key
# entry.bind ("<Delete>", lambda e: func (e, "<Delete>")) # When you press the'Delete' key
# entry.bind ("<F1>", lambda e: func (e, "<F1>")) # When you press the'F1'key (you can't hold down the Fn key)
# entry.bind ("<Home>", lambda e: func (e, "<Home>")) # When you press the'Home'key
# entry.bind ("<Up>", lambda e: func (e, "<Up>")) #'↑' When you press the key
# entry.bind ("<Prior>", lambda e: func (e, "<Prior>")) # When you press the'PageUp' key
# entry.bind ("<Next>", lambda e: func (e, "<Next>")) # When you press the'PageDown'key
# entry.bind ("<Control_L>", lambda e: func (e, "<Control_L>")) # When you press the'Left Ctrl'key
# entry.bind ("", lambda e: func (e, "")) # When you press the'Left Alt'and'a' keys at the same time
# entry.bind ("", lambda e: func (e, "")) # When you press the'Alt'and'a' keys at the same time
# entry.bind ("<Shift-Key-a>", lambda e: func (e, "<Shift-Key-a>")) # When you press the'Shift'and'a' keys at the same time (entry) The character entered in is'a'.
# entry.bind ("<Shift-Key-A>", lambda e: func (e, "<Shift-Key-A>")) # When you press the'Shift'and'A' keys at the same time (entry) The character entered in is'A')
# entry.bind ("a", lambda e: func (e, "a")) # When you press the'a'key
# entry.bind ("<KeyPress-b>", lambda e: func (e, "<KeyPress-b>")) # When you press the'b'key
# entry.bind ("<KeyRelease-c>", lambda e: func (e, "<KeyRelease-c>")) #'c' When you release the key
# entry.bind ("xyz", lambda e: func (e, "xyz")) # When you press'x','y','z' in order

win.mainloop ()
  • Answer # 1

    Confirmation: Is it a phenomenon that occurs only on Raspberry Pi without any problem in other environments?

    andalso respond when scrolling the mouse wheel. Is that the specification?

    Isn't the button itself (on the wheel) pressed down when operating the mouse wheel?
    The wheel operation itself