Tktreectrl: Ctrl needs to be Cmd on Mac OS X

Bug #202350 reported by sander
2
Affects Status Importance Assigned to Milestone
Coccinella
Fix Released
Low
Mats

Bug Description

Selecting different contacts in the roster on Mac OS X does not work like it should work. On Mac OS X Command should be used instead of Control but Control is used anyway which is a bug.

sander (s-devrieze)
Changed in coccinella:
assignee: nobody → matsben
importance: Undecided → Low
Revision history for this message
Mats (matsben) wrote : Re: [Bug 202350] [NEW] Tktreectrl: Ctrl needs to be Cmd on Mac OS X

It helps if you can describe exactly which operations that should have
Coomand instaed of Ctrl. There are tons of bindings for TreeCtrl. See
coccinella/bin/library/treectrl/treectrl.tcl. The code is very easy to read
and understand. Just look at thebind TreeCtrl <Control-KeyPress-Left> {
etc.

Revision history for this message
sander (s-devrieze) wrote :

> It helps if you can describe exactly which operations that should have
> Coomand instaed of Ctrl. There are tons of bindings for TreeCtrl. See
> coccinella/bin/library/treectrl/treectrl.tcl. The code is very easy to read
> and understand. Just look at thebind TreeCtrl <Control-KeyPress-Left> {
> etc.

I can't find it...it should be something like Control-ButtonPress

Revision history for this message
Mats (matsben) wrote :

At least some bindings are detecting this OS difference (treectrl.tcl):
# Command-click should provide a discontinuous selection on OSX
switch -- [tk windowingsystem] {
    "aqua" { set modifier Command }
    default { set modifier Control }
}
bind TreeCtrl <$modifier-ButtonPress-1> {
    set TreeCtrl::Priv(buttonMode) normal
    TreeCtrl::BeginToggle %W [%W item id {nearest %x %y}]
}

So what you are saying is that more bindings should have <$modifier- instead
of the hardcoded <Control-

Revision history for this message
sander (s-devrieze) wrote :

This is not yet fixed. It should work similary as Finder and other applications:
First press Cmd and hold the button, then left-click different files and/or directories-->you selection will extend without losing the previous selected files/dirs from the selection.

Bug1: Cmd+click, click, click,... does NOT work in Coccinella on Mac OS X
Bug2: Ctrl+click, click,... is still active whilst this only should work on Linux and Windows. The problem is that Ctrl+click is already used on Mac OS X to simulate a RMB click and so it will open the context menu of the roster which is not userfriendly.

Revision history for this message
Mats (matsben) wrote : Re: [Bug 202350] Re: Tktreectrl: Ctrl needs to be Cmd on Mac OS X

I reproduce this behavoiur exactly but can't understand why it happens since:
() 1 % bind TreeCtrl <Control-ButtonPress-1>
() 2 % bind TreeCtrl <Command-ButtonPress-1>

    set TreeCtrl::Priv(buttonMode) normal
    TreeCtrl::BeginToggle %W [%W item id {nearest %x %y}]

() 8 % bind .jmain.f.ro.box.tree <Control-ButtonPress-1>
() 9 % bind .jmain.f.ro.box.tree <Command-ButtonPress-1>

# ::TreeCtrl::BeginToggle --
#
# This procedure is typically invoked on control-button-1 presses. It
# begins the process of toggling a selection in the treectrl. Its
# exact behavior depends on the selection mode currently in effect
# for the treectrl.

Mats

Revision history for this message
Mats (matsben) wrote :

And the code:

# Command-click should provide a discontinuous selection on OSX
switch -- [tk windowingsystem] {
    "aqua" { set modifier Command }
    default { set modifier Control }
}
bind TreeCtrl <$modifier-ButtonPress-1> {
    set TreeCtrl::Priv(buttonMode) normal
    TreeCtrl::BeginToggle %W [%W item id {nearest %x %y}]
}

Revision history for this message
Mats (matsben) wrote :

Found it. I had a sequence of bindtags:

() 5 % bindtags .jmain.f.ro.box.tree
RosterTreeTag .jmain.f.ro.box.tree TreeCtrlDnD TreeCtrl TreeCtrlPost .jmain all

And it was the TreeCtrlDnD tag that interfered with the TreeCtrl tag.
Now changed:

() 6 % bind TreeCtrlDnD <Command-ButtonPress-1>

    set TreeCtrl::Priv(selectMode) toggle
    ::TreeCtrl::DnDButton1 %W %x %y
    break

() 7 % bind TreeCtrlDnD <Control-ButtonPress-1>

Changed in coccinella:
milestone: none → 0.96.10
status: New → Fix Committed
sander (s-devrieze)
Changed in coccinella:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.