Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

A Linux machine! because a 486 is a terrible thing to waste! (By jjs@wintermute.ucr.edu, Joe Sloan)


devel / comp.lang.tcl / Some keyboard bindings fire twice under macOS

SubjectAuthor
* Some keyboard bindings fire twice under macOSTorsten
`- Re: Some keyboard bindings fire twice under macOSsaitology9

1
Some keyboard bindings fire twice under macOS

<ti7d9m$1j34f$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=20322&group=comp.lang.tcl#20322

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: Torsten@example.com (Torsten)
Newsgroups: comp.lang.tcl
Subject: Some keyboard bindings fire twice under macOS
Date: Wed, 12 Oct 2022 23:58:04 +0200
Organization: A noiseless patient Spider
Lines: 38
Message-ID: <ti7d9m$1j34f$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 12 Oct 2022 21:58:15 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="80e3e0386ed254293ae805898ffb20f0";
logging-data="1674383"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18UASNbfHoG5RYqQPRBs23i"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.3.3
Cancel-Lock: sha1:R7dcb+dVaJpAm85Iissyyl2S0Eg=
Content-Language: en-GB
 by: Torsten - Wed, 12 Oct 2022 21:58 UTC

My app runs under Windows, Linux and macOS.
Two menu bar entries have the accelerators Control-Up/Down, resp. Command-Up/Down under macOS.
Others have other accelerators, e.g. Control-A/B, resp. Command-A/B under macOS.

When I select one of the four menu entry, the command is called once under all three OSs.
When I press Command-Up/Down on the keyboard under macOS, the command is called *twice*.
This is *not* the case for the other keyboard bindings Command-A/B.

What's the difference with Command-Up/Down bindings under macOS?

The following code demonstrates the behaviour:

- - - - - - - - - -
package require Tk

if {[tk windowingsystem] eq "aqua"} {
set APPDATA(control) "Command"
} else {
set APPDATA(control) "Control"
}

proc do_cmd {} {
puts "do_cmd"
}

menu .mbar
.. configure -menu .mbar
menu .mbar.mm -tearoff 0
..mbar.mm add command -label Up -accelerator $APPDATA(control)-Up -command do_cmd
..mbar.mm add command -label Down -accelerator $APPDATA(control)-Down -command do_cmd
..mbar.mm add command -label A -accelerator $APPDATA(control)-A -command do_cmd
..mbar.mm add command -label B -accelerator $APPDATA(control)-B -command do_cmd
..mbar add cascade -label MyMenu -menu .mbar.mm

bind . <$APPDATA(control)-Up> "do_cmd"
bind . <$APPDATA(control)-Down> "do_cmd"
bind . <$APPDATA(control)-a> "do_cmd"
bind . <$APPDATA(control)-b> "do_cmd"

Re: Some keyboard bindings fire twice under macOS

<ti7qvu$1d7f$1@gioia.aioe.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=20323&group=comp.lang.tcl#20323

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!aioe.org!a5rWVvs5S5ZXUwkNcVnRMw.user.46.165.242.75.POSTED!not-for-mail
From: saitology9@gmail.com (saitology9)
Newsgroups: comp.lang.tcl
Subject: Re: Some keyboard bindings fire twice under macOS
Date: Wed, 12 Oct 2022 21:51:58 -0400
Organization: Aioe.org NNTP Server
Message-ID: <ti7qvu$1d7f$1@gioia.aioe.org>
References: <ti7d9m$1j34f$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="46319"; posting-host="a5rWVvs5S5ZXUwkNcVnRMw.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.3.2
Content-Language: en-US
X-Notice: Filtered by postfilter v. 0.9.2
 by: saitology9 - Thu, 13 Oct 2022 01:51 UTC

On 10/12/22 5:58 PM, Torsten wrote:
>
> When I select one of the four menu entry, the command is called once
> under all three OSs.
> When I press Command-Up/Down on the keyboard under macOS, the command is
> called *twice*.
> This is *not* the case for the other keyboard bindings Command-A/B.
>
> What's the difference with Command-Up/Down bindings under macOS?
>

Just a guess but it sounds like there may be additional bindings for
those keys. What do you see if you run the following commands?

bind . <$APPDATA(control)-Up>
bind . <$APPDATA(control)-Down>


devel / comp.lang.tcl / Some keyboard bindings fire twice under macOS

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor