]> Sergey Matveev's repositories - tofuproxy.git/blobdiff - verify.go
Hotkeys
[tofuproxy.git] / verify.go
index ed9865094a8d6768ebef4cc9fbadacdeb593f08a..4c5ad35d526b9f0ab7daa709473c6b0423bccd48 100644 (file)
--- a/verify.go
+++ b/verify.go
@@ -114,13 +114,27 @@ if {$daneStatus ne ""} {
     $lDANE configure -bg $daneColour($daneStatus)
     $lDANE configure -text "DANE-EE: $daneStatus"
 }
-button .bAccept -text "Accept" -bg green -command { exit 10 }
-button .bOnce -text "Once" -bg green -command { exit 11 }
-button .bReject -text "Reject" -bg red -command { exit 12 }
+proc doAccept {} { exit 10 }
+proc doOnce {} { exit 11 }
+proc doReject {} { exit 12 }
+button .bAccept -text "Accept" -bg green -command doAccept
+button .bOnce -text "Once" -bg green -command doOnce
+button .bReject -text "Reject" -bg red -command doReject
 grid .fButtons
 grid .lDANE .bAccept .bOnce .bReject -in .fButtons
 grid rowconfigure . 0 -weight 1
 grid columnconfigure . 0 -weight 1
+
+bind . <KeyPress> {switch -exact %K {
+    q {exit 0} ; # reject once
+    a doAccept
+    o doOnce
+    r doReject
+    n {.bNextTheir invoke}
+    p {.bPrevTheir invoke}
+    N {.bNextOur invoke}
+    P {.bPrevOur invoke}
+}}
 `
 
 var (