Keymapping is very close to it, but is has a few differences:
- shortcuts are organized in categories
- categories are attached to Morphs (to classes, not to instances)
- every instance of the morphs who has attached the category, uses its shortcuts.
Now I'm a little busy and stuck with Keymapping UI, but I expect to have something working in the near future too :).
Guille
Stef: Yes! as soon as i'm finished with a paper (till next week) i
will work on integrating the functionality into the �latest Pharo.
And publish it as a slice perhaps? In �Morphic-Keybindings ?
Dennis: GMCondition (GauchoMorphic = GM ) �are preconditions that must
be satisfied for the key binding to be applied. In case they aren't
satisfied, an rejected event is recorded, specifying the violatedMmm,
conditions. For example, you might want to restrict that a particular
morph can only be closed ( cmd-w in the example above) if its selected
(selected condition). I found it useful for customizing the Gaucho
interface to a particular set of interaction rules.
Fernando
On Mon, Jan 31, 2011 at 7:59 PM, St�phane Ducasse
<stephane.ducasse@inria.fr> wrote:
> I have the impression that Guillermo work is not the same as GlobalKeyBinding but I may be wrong
> Anyway fernando could I have a look at your code?
> Because I really want that.
>
> Stef
>
> On Jan 31, 2011, at 4:18 PM, Fernando Olivero wrote:
>
>> Hi, recently there were some discussion on implementing KeyBindings for our IDE.
>>
>> There are at least 3 frameworks which address this functionality, the
>> last one mentioned is the work done by Guillermo.
>> I've implemented another one, for Gaucho.
>>
>> From what i understand, the previous work focuses on implementing
>> GLOBAL keybindings .
>> Basically adding behavior to HandMorph or PasteUpMorph or the toolbar
>> ( docking bar) present in the World.
>>
>> My implementation is a generic keybinding for any Morph, which can be
>> applied to any morph. Special cases for the docking bar or the paste
>> up Morph can be easily implemented following this uniform scheme.
>>
>> I didn't have the time to integrate it into Pharo yet, but will do in
>> one week from now.
>>
>> I like to bring up the discussion on which one we should adopt and
>> integrate into Morphic, points in favor of my approach:
>> 1) clean
>> 2) customizable
>> 3) generic: no special cases
>>
>> I believe the other Global keybindings should be a subset of this
>> generic keybinding mechanism.
>>
>> Fernando
>>
>> pd: From a previous mail:
>>
>> "...
>> So for example, if you want to delete any �Morph from the system
>> by pressing cmd-w, you have to add the following binding:
>>
>> condition := �GMCondition
>> � � � compositeWith:
>> � � � � � � � � � � � � � #( #understandsKeyBindingCommandCondition
>> � � � � � � � � � � � � � � � #uneditedCondition ) ).
>> � �binding := GMKeyBinding
>> � � � � � � � actingOn: $w asciiValue
>> � � � � � � � modifiedBy: #(#command)
>> � � � � � � � satisfying: condition
>> � � � � � � �applying: #close.
>> m := Morph new.
>> m addKeyBinding: binding .
>> ...
>> "
>>
>> pd2: Useful and related comment from Stef
>> "..
>> A classVar Binding and an instance var binding.
>> **All** the methods only access binding
>> binding get initialized with the default table defined in Binding
>> => we can have table binding sharing
>> => we can have instance based customization.
>>
>
>