OriginalBugID: 4437 RFE
Version: 8.3
SubmitDate: '2000-03-21'
LastModified: '2000-04-07'
Severity: MED
Status: UnAssn
Submitter: techsupp
ChangedBy: hobbs
OS: All
Name:
Jay Schmidgall
Comments:
Note that this functionality is backwards compatible. Only if the None
or ! modifiers are specified does the new behavior occur.
DesiredBehavior:
Currently there is no simple way to create a binding on a widget which fires when a key is pressed with no modifiers, but which does not fire if that same key is pressed with a binding. For example,
bind .button <Key-f> { puts fires }
will fire when the f key is pressed, but will also fire when Control-f is pressed. One needs to write more code to weed out the cases when a modifier is present.
If a 'None' modifier was provided, one could specify
bind .button <None-Key-f> { puts fires }
and pressing Control-f would not fire.
A further consideration would be to provide exact match functionality. For example, if one specifies
bind .button <!Control-Key-f> { puts fires }
then the bind would fire only when only Control-f was pressed. If any other modifier was present, or a pointer button was depressed at the same time, the binding would not fire.
In this case, the None modifier is the same as ! with no modifiers specified. That is,
bind .button <None-Key-f> { puts fires }
is equivalent to
bind .button <!Key-f> { puts fires }
Note this functionality is already present in the X translation table syntax. It would be nice if Tk could be extended to provide analogous behavior.
Logged In: YES
user_id=79902
I'm not quite sure this is as good an idea as it seems. The
problem is that there are a lot more modifiers than there
appear to be; requiring that someone turns off CapsLock and
(more particularly) NumLock just to activate a binding is
not a good idea, as experience prior to Tk4 showed.