Always bind the return key to the default button
If a dialog/window has a default button registered not every platform associates the return key with that button, but all users do. We have to register the binding of the return key ourselves to make sure the user's expectations of pressing return will activate the default button are met. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Shawn O. Pearce committed
Apr 4, 2007 at 11:45 UTC
4372da3441561b3852c0bf466304f1e4f3c06b3f
1 file changed
+2
git-gui.sh
+2
@@ -2787,6 +2787,7 @@ proc do_push_anywhere {} {
2787
2788
bind $w <Visibility> "grab $w; focus $w.buttons.create"
2789
bind $w <Key-Escape> "destroy $w"
2790
+ bind $w <Key-Return> [list start_push_anywhere_action $w]
2791
wm title $w "[appname] ([reponame]): Push"
2792
tkwait window $w
2793
}
@@ -4713,6 +4714,7 @@ proc do_options {} {
4714
4715
bind $w <Visibility> "grab $w; focus $w.buttons.save"
4716
bind $w <Key-Escape> "destroy $w"
4717
+ bind $w <Key-Return> [list do_save_config $w]
4718
wm title $w "[appname] ([reponame]): Options"
4719
tkwait window $w
4720
}