• Some keyboard bindings fire twice under macOS

    From Torsten@21:1/5 to All on Wed Oct 12 23:58:04 2022
    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"

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From saitology9@21:1/5 to Torsten on Wed Oct 12 21:51:58 2022
    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>

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)