TkInter keypress, keyrelease events

后端 未结 4 1817
野性不改
野性不改 2020-12-01 11:52

I understood that the Tk keypress and keyrelease events were supposed only to fire when the key was actually pressed or released?

However with the following simple c

4条回答
  •  独厮守ぢ
    2020-12-01 12:32

    Ok some more research found this helpful post which shows this is occuring because of X's autorepeat behaviour. You can disable this by using

    os.system('xset r off')
    

    and then reset it using "on" at the end of your script. The problem is this is global behaviour - not just my script - which isn't great so I'm hoping someone can come up with a better way.

提交回复
热议问题