Version 1 of disable autorepeat under Windows

Updated 2009-07-01 13:12:23 by LV

fr disable repetition of characters in widgets while key is pressed.

for X11 see disable autorepeat under X11

  package require Tk
  proc disable-autorepeat  {w} {
    bind $w <Any-KeyPress> {bind %W <KeyPress-%K> {break};bind %W <KeyRelease-%K> {single-key %W %K}}
  }
  proc single-key {w K} {
    bind $w <KeyPress-$K> [list bind $w <KeyPress-$K> {break} ; bind %W <KeyRelease-$K> {single-key %W %K}]
  }
  text .t
  pack .t
  .t insert end "autorepeat is disabled under Windows OS"
  disable-autorepeat .t