Hi Johannes Schindelin, Regarding your messages,

> However, it might not even need to put in _such_ a lot of work: in my
> tests, `Control-,` worked just as well as `Control-comma`. To test this
> for yourself, use this snippet (that is slightly modified from the
> example at the bottom of https://www.tcl.tk/man/tcl/TkCmd/bind.htm so
> that it reacts _only_ to Control+comma instead of all keys):
> 
> -- snip --
> set keysym "Press any key"
> pack [label .l -textvariable keysym -padx 2m -pady 1m]
> #bind . <Key> {
> bind . <Control-,> {
>     set keysym "You pressed %K"
> }
> -- snap --

I tried this, but unfortunatly, it didn't worked for me. My tclsh version is
"8.6".  The script crashed with following error message

---
bad event type or keysym ","
    while executing
"bind . <Control-,> {
    set keysym "You pressed %K"
}"
    (file "./test.tcl" line 6)
---


The complete ( or modified ) script which I used is given below

---
package require Tk

set keysym "Press any key"
pack [label .l -textvariable keysym -padx 2m -pady 1m]
#bind . <Key> {
bind . <Control-,> {
    set keysym "You pressed %K"
}

---

>From the error messages, I understand that, "<Control-,>" will not work
instead of "<Control-comma>" .

> 
> So I could imagine that something like this could serve as an initial
> draft for a function that you can turn into a "good enough" version:
> 
> -- snip --
> proc QKeySequence2keysym {keystroke} {
>       regsub -all {(?i)Ctrl\+} $keystroke "Control-" keystroke
>       regsub -all {(?i)Alt\+} $keystroke "Alt-" keystroke
>       regsub -all {(?i)Shift\+} $keystroke "Shift-" keystroke
>       return $keystroke
> }
> -- snap --
> 
> That way, you don't have to introduce settings separate from
> `git-cola`'s, and you can reuse the short-and-sweet variable name.

If my previous observation is correct, then we may have to translate a list
of key names ( in addition to atl,ctrl & shirt ) to get it working .


> Ciao,
> Johannes

Reply via email to