git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / Atom feed
From: Johannes Schindelin <Johannes.Schindelin@gmx.de>
To: Harish Karumuthil <harish2704@gmail.com>
Cc: Pratyush Yadav <me@yadavpratyush.com>,
	git@vger.kernel.org, David Aguilar <davvid@gmail.com>
Subject: Re: [PATCH] Feature: custom guitool commands can now have custom keyboard shortcuts
Date: Mon, 7 Oct 2019 12:01:47 +0200 (CEST)
Message-ID: <nycvar.QRO.7.76.6.1910071159530.46@tvgsbejvaqbjf.bet> (raw)
In-Reply-To: <e71835129c0628ff3b9a0653febc3737128fa23c.camel@gmail.com>

Hi Harish,

On Mon, 7 Oct 2019, Harish Karumuthil wrote:

> > 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)
> ---

That's too bad! I tested this on Windows, and I imagine it just does not
work on Linux/macOS...

> 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 .

I fear you're right. Hopefully we can get away with a relatively short
list...

Ciao,
Johannes

  reply index

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-29 11:38 Harish K
2016-03-31 16:41 ` David Aguilar
2016-04-01  6:32   ` harish k
2019-10-03 14:48     ` harish k
2019-10-03 21:44       ` Pratyush Yadav
2019-10-04  8:49         ` Johannes Schindelin
2019-10-04 12:01           ` Pratyush Yadav
2019-10-05 20:16             ` Harish Karumuthil
2019-10-05 21:01               ` Pratyush Yadav
2019-10-06  9:49                 ` Johannes Schindelin
2019-10-06 18:39                   ` Pratyush Yadav
2019-10-06 19:37                     ` Philip Oakley
2019-10-06 20:27                     ` Johannes Schindelin
2019-10-06 21:06                       ` Pratyush Yadav
2019-10-07  9:20                         ` GitGUIGadget, was " Johannes Schindelin
2019-10-07 10:43                           ` Birger Skogeng Pedersen
2019-10-07 19:16                             ` Alban Gruin
2019-11-19 22:09                         ` Making GitGitGadget's list -> PR comment mirroring bidirectional, " Johannes Schindelin
2019-11-20 14:22                           ` Pratyush Yadav
2019-10-06 22:40                       ` Philip Oakley
2019-10-07  6:22                   ` Harish Karumuthil
2019-10-07 10:01                     ` Johannes Schindelin [this message]
2019-10-08 19:31                       ` Harish Karumuthil
2019-10-09 20:42                         ` Johannes Schindelin
2019-10-13 20:09                         ` Pratyush Yadav
2019-10-07  6:13                 ` Harish Karumuthil
2019-10-13 19:17                   ` Pratyush Yadav
  -- strict thread matches above, loose matches on Subject: below --
2016-03-29 11:29 Harish K
2016-03-31 16:49 ` David Aguilar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=nycvar.QRO.7.76.6.1910071159530.46@tvgsbejvaqbjf.bet \
    --to=johannes.schindelin@gmx.de \
    --cc=davvid@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=harish2704@gmail.com \
    --cc=me@yadavpratyush.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

git@vger.kernel.org list mirror (unofficial, one of many)

Archives are clonable:
	git clone --mirror https://public-inbox.org/git
	git clone --mirror http://ou63pmih66umazou.onion/git
	git clone --mirror http://czquwvybam4bgbro.onion/git
	git clone --mirror http://hjrcffqmbrq6wope.onion/git

Example config snippet for mirrors

Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.version-control.git
	nntp://ou63pmih66umazou.onion/inbox.comp.version-control.git
	nntp://czquwvybam4bgbro.onion/inbox.comp.version-control.git
	nntp://hjrcffqmbrq6wope.onion/inbox.comp.version-control.git
	nntp://news.gmane.io/gmane.comp.version-control.git

 note: .onion URLs require Tor: https://www.torproject.org/

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git