Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

problems with Tk non-english shift bindings/accelerators on macOS

15 views
Skip to first unread message

danom...@gmail.com

unread,
Mar 27, 2018, 5:45:22 AM3/27/18
to
(SNIP, splitting this from a previous post into a separate thread)

-----

Howdy all,

We've finally transitioned an open source project (Pure Data http://puredata.info) from TK 8.4 to TK 8.5+ on macOS and have run into a couple problems that may be related to the Cocoa key event handling.

# Shift key bindings on French keyboard mappings

The PureData Tk GUI uses MOD+SHIFT+key bindings which are also set as menu accelerators. This works fine with the English keyboard mapping. We're now running into issues with other keyboard locales, namely French so far, where the bindings with Shift result in the menu accelerator firing so it may be an issue with the menu event filtering.

For example, the "Bang" shortcut is bound as:

bind all <$::modifier-Shift-Key-B> {menu_send %W bng}
bind all <$::modifier-Shift-Key-b> {menu_send %W bng}

and the menu item:

$mymenu add command -label [_ "Bang"] -accelerator "$accelerator+Shift+B" \
-command {menu_send $::focused_window bng}

With the English keyboard mapping, the $::modifier-Shift-Key-b fires and the menu item's command is ignored (expected behavior).

With the French keyboard mapping, the $::modifier-Shift-Key-B fires AND the menu item command fires. It seems as though the capital B doesn't get matched to the menu accelerator binding.

The German keyboard mapping behaves the same as the English one.

Judging from looking into the TK sources, I think this is related to shifting the case of a character when the Shift modifier is used.

-----
Dan Wilcox
danomatika.com
robotcowboy.com
0 new messages