Binding missing details in Tkinter

Is there a way to bind a function to an event, which does not have a detail? If I print events for certain clicks on the mouse on my Linux machine, I am getting num=8, 9 (via button.bind("<Button>", lambda event: print(event))), but the details like <Button-8> doesn’t work and ends with the error.

Could you please show a more complete example to clarify the problem?

Well, I am afraid, I am not able to determine the exact extent of the code sample. But let’s try:

#Import used modules
import tkinter as tk
from tkinter import ttk

#Main window creation
okno = tk.Tk()
okno.geometry("600x400")
okno.title("Skrolování")

#Canvas widget
platno = tk.Canvas(master = okno, bg = "red", scrollregion = (0,0,2000,5000)) 
platno.create_line(0,0,2000,5000, fill = "green", width = 10) 
platno.pack(expand = True, fill = "both")

#Horizontal scrollbar widget
skrolovac_cviceni = ttk.Scrollbar(okno, orient = "horizontal", command = platno.xview) 
platno.configure(xscrollcommand = skrolovac_cviceni.set)
skrolovac_cviceni.place(relx = 1, rely = 1, relwidth = 1, anchor = "se")

#FUNCTIONALITY TEST - scroll horizontally with mouse wheel on Linux
#platno.bind("<Button-4>", lambda event: platno.xview_scroll(1, "units"))

#Num 8 and 9 - sizde buttons of the mouse scroll events
platno.bind("<Button-8>", lambda event: platno.xview_scroll(1, "units"))
platno.bind("<Button-9>", lambda event: platno.xview_scroll(-1, "units"))

#Main windows loop
okno.mainloop()