From: Hans-Christoph S. <ha...@at...> - 2011-07-12 01:02:45
|
In Pd-extended, I'm getting a strange inconsistency with binding to key combinations that is only triggered with key bindings that include Shift in it. This happens only on Mac OS X 10.6 using the built-in Tcl/Tk. Mac OS X 10.5 with custom built 8.5.8 works fine, as well as Windows and GNU/Linux. The windows are each a toplevel that has a canvas covering the full window, then everything else is drawn onto the canvas. The bindings in question are: set ::modifier "Mod1" ;# for x-platform support set ::altkey "Option" bind all <$::modifier-Key-a> {menu_send %W selectall} bind all <$::modifier-$::altkey-Key-a> {menu_toggle_autopatch} bind all <$::modifier-Shift-Key-B> {menu_send %W bng} When I press Cmd-a, menu_send is called once with the canvas id. Same goes for Cmd-Option-a. But when I press Cmd-Shift-b, menu_send is called twice, once for the toplevel and again for the canvas. There are about 30 $::modifier-Key bindings, 4 $::modifier-$::altkey- Key bindings, and 15 $::modifier-Shift-Key bindings, and this behavior is consistent across all of them, it is only the bindings with the Shift that get sent twice. You can see the full code in question here: http://pure-data.git.sourceforge.net/git/gitweb.cgi?p=pure-data/pd-extended.git;a=blob;f=tcl/pd_bindings.tcl;h=554adbd9bd5ddd476e51caddfb0aa1e5536990c1;hb=HEAD Any ideas? .hc ---------------------------------------------------------------------------- "We have nothing to fear from love and commitment." - New York Senator Diane Savino, trying to convince the NY Senate to pass a gay marriage bill |
From: Jeff H. <je...@ac...> - 2011-07-12 01:17:50
|
Can you check the 'winfo server .' return of the working and non-working OS X builds? Maybe also against an ActiveTcl version of your choice? I believe this may be a Carbon vs. Cocoa issue. Jeff On 11/07/2011 6:02 PM, Hans-Christoph Steiner wrote: > In Pd-extended, I'm getting a strange inconsistency with binding to > key combinations that is only triggered with key bindings that include > Shift in it. This happens only on Mac OS X 10.6 using the built-in > Tcl/Tk. Mac OS X 10.5 with custom built 8.5.8 works fine, as well as > Windows and GNU/Linux. The windows are each a toplevel that has a > canvas covering the full window, then everything else is drawn onto > the canvas. The bindings in question are: > > set ::modifier "Mod1" ;# for x-platform support > set ::altkey "Option" > bind all<$::modifier-Key-a> {menu_send %W selectall} > bind all<$::modifier-$::altkey-Key-a> {menu_toggle_autopatch} > bind all<$::modifier-Shift-Key-B> {menu_send %W bng} > > When I press Cmd-a, menu_send is called once with the canvas id. Same > goes for Cmd-Option-a. But when I press Cmd-Shift-b, menu_send is > called twice, once for the toplevel and again for the canvas. > > There are about 30 $::modifier-Key bindings, 4 $::modifier-$::altkey- > Key bindings, and 15 $::modifier-Shift-Key bindings, and this > behavior is consistent across all of them, it is only the bindings > with the Shift that get sent twice. > > You can see the full code in question here: > http://pure-data.git.sourceforge.net/git/gitweb.cgi?p=pure-data/pd-extended.git;a=blob;f=tcl/pd_bindings.tcl;h=554adbd9bd5ddd476e51caddfb0aa1e5536990c1;hb=HEAD > > Any ideas? |
From: Hans-Christoph S. <ha...@at...> - 2011-07-12 01:52:11
|
I also think its a problem on Cocoa but not on Carbon. Here's the info: working server: QD10R30 Apple 1058 non-working server: CG545.0 Apple AppKit GC 1038.36 Mac OS X 1068 .hc On Jul 11, 2011, at 9:16 PM, Jeff Hobbs wrote: > Can you check the 'winfo server .' return of the working and non- > working OS X builds? Maybe also against an ActiveTcl version of > your choice? > > I believe this may be a Carbon vs. Cocoa issue. > > Jeff > > On 11/07/2011 6:02 PM, Hans-Christoph Steiner wrote: >> In Pd-extended, I'm getting a strange inconsistency with binding to >> key combinations that is only triggered with key bindings that >> include >> Shift in it. This happens only on Mac OS X 10.6 using the built-in >> Tcl/Tk. Mac OS X 10.5 with custom built 8.5.8 works fine, as well as >> Windows and GNU/Linux. The windows are each a toplevel that has a >> canvas covering the full window, then everything else is drawn onto >> the canvas. The bindings in question are: >> >> set ::modifier "Mod1" ;# for x-platform support >> set ::altkey "Option" >> bind all<$::modifier-Key-a> {menu_send %W selectall} >> bind all<$::modifier-$::altkey-Key-a> {menu_toggle_autopatch} >> bind all<$::modifier-Shift-Key-B> {menu_send %W bng} >> >> When I press Cmd-a, menu_send is called once with the canvas id. >> Same >> goes for Cmd-Option-a. But when I press Cmd-Shift-b, menu_send is >> called twice, once for the toplevel and again for the canvas. >> >> There are about 30 $::modifier-Key bindings, 4 $::modifier-$::altkey- >> Key bindings, and 15 $::modifier-Shift-Key bindings, and this >> behavior is consistent across all of them, it is only the bindings >> with the Shift that get sent twice. >> >> You can see the full code in question here: >> http://pure-data.git.sourceforge.net/git/gitweb.cgi?p=pure-data/pd-extended.git;a=blob;f=tcl/pd_bindings.tcl;h=554adbd9bd5ddd476e51caddfb0aa1e5536990c1;hb=HEAD >> >> Any ideas? ---------------------------------------------------------------------------- Mistrust authority - promote decentralization. - the hacker ethic |
From: Ned D. <na...@ac...> - 2011-07-12 02:52:52
|
In article <CAD...@at...>, Hans-Christoph Steiner <ha...@at...> wrote: > I also think its a problem on Cocoa but not on Carbon. Here's the info: I also believe this is a Cocoa Aqua Tcl/Tk vs Carbon problem and is the root cause behind this problem seen in Python's IDLE on OS X: http://bugs.python.org/issue11055 -- Ned Deily, na...@ac... |
From: Hans-Christoph S. <ha...@at...> - 2011-07-12 03:08:24
|
On Jul 11, 2011, at 10:52 PM, Ned Deily wrote: > In article <CAD...@at...>, > Hans-Christoph Steiner <ha...@at...> wrote: > >> I also think its a problem on Cocoa but not on Carbon. Here's the >> info: > > I also believe this is a Cocoa Aqua Tcl/Tk vs Carbon problem and is > the > root cause behind this problem seen in Python's IDLE on OS X: > > http://bugs.python.org/issue11055 Yeah, sounds the same. Pd-extended also uses that binding for Save As, and it also gets triggered twice. .hc ---------------------------------------------------------------------------- Computer science is no more related to the computer than astronomy is related to the telescope. -Edsger Dykstra |
From: Kevin W. <kw...@co...> - 2011-07-18 04:18:20
|
On 7/11/11 11:08 PM, Hans-Christoph Steiner wrote: >> I also believe this is a Cocoa Aqua Tcl/Tk vs Carbon problem and is >> > the >> > root cause behind this problem seen in Python's IDLE on OS X: >> > >> > http://bugs.python.org/issue11055 > > Yeah, sounds the same. Pd-extended also uses that binding for Save > As, and it also gets triggered twice. > > .hc I've committed a fix for this issue on both 8.6 trunk and the Tk-Cocoa 8.5 backport branch, both in Fossil. You'll need to do a fresh checkout and build from Fossil to test. It will not be corrected in Snow Leopard's build of Tk-Cocoa, though it should make it into a future version of ActiveTcl. The fix was a one-liner change in tkMacOSXMenu.c, calling for the lower-case string of the accelerator key, which I figured out based on advice here: http://stackoverflow.com/questions/404830/cocoa-wont-capture-shift-modifier Stack Overflow is a very useful resource. --Kevin -- Kevin Walzer Code by Kevin http://www.codebykevin.com |
From: Kevin W. <kw...@co...> - 2011-07-12 12:25:06
|
On 7/11/11 9:02 PM, Hans-Christoph Steiner wrote: > > In Pd-extended, I'm getting a strange inconsistency with binding to > key combinations that is only triggered with key bindings that include > Shift in it. This happens only on Mac OS X 10.6 using the built-in > Tcl/Tk. Mac OS X 10.5 with custom built 8.5.8 works fine, as well as > Windows and GNU/Linux. The windows are each a toplevel that has a > canvas covering the full window, then everything else is drawn onto > the canvas. The bindings in question are: > > set ::modifier "Mod1" ;# for x-platform support > set ::altkey "Option" > bind all<$::modifier-Key-a> {menu_send %W selectall} > bind all<$::modifier-$::altkey-Key-a> {menu_toggle_autopatch} > bind all<$::modifier-Shift-Key-B> {menu_send %W bng} > > When I press Cmd-a, menu_send is called once with the canvas id. Same > goes for Cmd-Option-a. But when I press Cmd-Shift-b, menu_send is > called twice, once for the toplevel and again for the canvas. > > There are about 30 $::modifier-Key bindings, 4 $::modifier-$::altkey- > Key bindings, and 15 $::modifier-Shift-Key bindings, and this > behavior is consistent across all of them, it is only the bindings > with the Shift that get sent twice. > > You can see the full code in question here: > http://pure-data.git.sourceforge.net/git/gitweb.cgi?p=pure-data/pd-extended.git;a=blob;f=tcl/pd_bindings.tcl;h=554adbd9bd5ddd476e51caddfb0aa1e5536990c1;hb=HEAD > > Any ideas? > > .hc > I'll try to take a look at this soon. --Kevin -- Kevin Walzer Code by Kevin http://www.codebykevin.com |
From: Ned D. <na...@ac...> - 2011-07-18 05:28:39
|
In article <4E2...@co...>, Kevin Walzer <kw...@co...> wrote: > On 7/11/11 11:08 PM, Hans-Christoph Steiner wrote: > >> I also believe this is a Cocoa Aqua Tcl/Tk vs Carbon problem and is > >> > the > >> > root cause behind this problem seen in Python's IDLE on OS X: > >> > > >> > http://bugs.python.org/issue11055 > > > > Yeah, sounds the same. Pd-extended also uses that binding for Save > > As, and it also gets triggered twice. > > > > .hc > > I've committed a fix for this issue on both 8.6 trunk and the Tk-Cocoa > 8.5 backport branch, both in Fossil. You'll need to do a fresh checkout > and build from Fossil to test. It will not be corrected in Snow > Leopard's build of Tk-Cocoa, though it should make it into a future > version of ActiveTcl. Thanks, Kevin! I'd be happy to test it with Python if someone wants to send a test build of ActiveTcl. -- Ned Deily, na...@ac... |
From: Ned D. <na...@ac...> - 2011-07-22 20:35:19
|
In article <nad...@ne...>, Ned Deily <na...@ac...> wrote: > In article <4E2...@co...>, > Kevin Walzer <kw...@co...> wrote: > > On 7/11/11 11:08 PM, Hans-Christoph Steiner wrote: > > >> I also believe this is a Cocoa Aqua Tcl/Tk vs Carbon problem and is > > >> > the > > >> > root cause behind this problem seen in Python's IDLE on OS X: > > >> > > > >> > http://bugs.python.org/issue11055 > > > > > > Yeah, sounds the same. Pd-extended also uses that binding for Save > > > As, and it also gets triggered twice. > > > > > > .hc > > > > I've committed a fix for this issue on both 8.6 trunk and the Tk-Cocoa > > 8.5 backport branch, both in Fossil. You'll need to do a fresh checkout > > and build from Fossil to test. It will not be corrected in Snow > > Leopard's build of Tk-Cocoa, though it should make it into a future > > version of ActiveTcl. > > Thanks, Kevin! I'd be happy to test it with Python if someone wants to > send a test build of ActiveTcl. I see there is now an ActiveTcl 8.5.10.1 available on the download page. Installing it does solve the Python problem above. Thanks, all! http://www.activestate.com/activetcl/downloads -- Ned Deily, na...@ac... |