Python Forum
How to hardcode event.state? (tkinter)
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to hardcode event.state? (tkinter)
#1
I have a small question.
if I print the key event while holding shift and control I see:
<KeyPress event state=Shift|Control|Mod2 keysym=Left keycode=113 x=-165 y=572>
But when I print event.state I see a number. That number is different on different systems. For example shift+left is event.state 1 on linux mint and event.state 16 on linux lite. How am I supposed to detect shift+other-key in a correct way?
Reply


Messages In This Thread
How to hardcode event.state? (tkinter) - by philipbergwerf - Oct-24-2022, 12:55 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  python311 tkinter moving mouse event. janeik 1 989 Jul-01-2023, 02:00 PM
Last Post: deanhystad
  create loop of subplot plotly dash without hardcode tonycat 0 3,947 Sep-23-2020, 08:40 AM
Last Post: tonycat
  State graph Kaluss 1 2,275 Mar-18-2019, 05:29 PM
Last Post: nilamo

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020