I've asked this before, but I didn't get any replies and searching
really is not helping. So I decided to ask it differently:
-----------------------------------
set option 1
set a 1
package require Tk
text .t
pack .t
.t insert end $a
proc p.update {argUD} {
global a
if {$argUD == "up"} {
incr a
.t delete 1.0 end; .t insert end $a
}
if {$argUD == "down"} {
incr a -1
.t delete 1.0 end; .t insert end $a
}
}
if {$option == 1} {
bind . <KeyPress-Up> "p.update up"
bind . <KeyPress-Down> "p.update down"
}
if {$option == 2} {
bind . <Control_L><Up> "p.update up"
bind . <Control_L><Down> "p.update down"
}
bind . <Alt_L><q> {exit 0}
wm protocol . WM_DELETE_WINDOW {exit 0} -----------------------------------
The script begins by setting "option" as 1. That means only the up
and down arrow keys will be used to increase and decrease the counter.
Note that if you press and hold either key, the counter display will
increase or decrease, maybe very rapidly (that depends on your own
keyboard speed/response settings).
Please edit the script and change the first line so "option" becomes
2. That means the new sets of keys to increase and decrease the
counter is Control+up to increase and Control+down to decrease the
counter. It works, but try pressing and holding Control once and
continuously while pressing either arrow key repeatedly. That doesn't
work for me. The keys will no longer respond after the first use, I
have to release the modifier key before I can use that key combination
again. It seems that modifiers have the power to momentarily suspend
X's autorepeat mechanism.
This is on Linux, of course.
Is there a way to preserve the "rapid fire" with modifiers in Tk?
--
Luc
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)