About KeyBindings

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

About KeyBindings

Fernando olivero-2
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.

Reply | Threaded
Open this post in threaded view
|

Re: About KeyBindings

Stéphane Ducasse

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

Cool!
I want that. I would like to have morph specific table but with possible sharing

I would like to have editor table (now defined as instance variables of the metaclasses) defined
as ClassVar and instance Variables of the class so that we could share large table by default
and have instance specific table if possible.

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.


>
> 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.
>


Reply | Threaded
Open this post in threaded view
|

Re: About KeyBindings

Denis Kudriashov
In reply to this post by Fernando olivero-2
Hello, very interesting work.

Can you provide some description?
What is GMCondition? What is #compositeWith: , #modifiedWith:?

Best regards,
Denis

2011/1/31 Fernando Olivero <[hidden email]>
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.


Reply | Threaded
Open this post in threaded view
|

Re: About KeyBindings

Tudor Girba
In reply to this post by Fernando olivero-2
Hi Fernando,

Sounds nice. I would be interested in having a bindings-per-morph solution.

Cheers,
Doru


On 31 Jan 2011, at 16:18, 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.
>

--
www.tudorgirba.com

"Yesterday is a fact.
 Tomorrow is a possibility.
 Today is a challenge."




Reply | Threaded
Open this post in threaded view
|

Re: About KeyBindings

Stéphane Ducasse
In reply to this post by Fernando olivero-2
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.
>


Reply | Threaded
Open this post in threaded view
|

Re: About KeyBindings

Fernando olivero-2
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 violated
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
<[hidden email]> 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.
>>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: About KeyBindings

Guillermo Polito
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

On Mon, Jan 31, 2011 at 6:26 PM, Fernando Olivero <[hidden email]> wrote:
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
<[hidden email]> 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.
>>
>
>


Reply | Threaded
Open this post in threaded view
|

Re: About KeyBindings

Stéphane Ducasse
In reply to this post by Fernando olivero-2

On Jan 31, 2011, at 10:26 PM, Fernando Olivero wrote:

> 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 ?

ok good luck for ICPC :) I cross my fingers for you.


> 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 violated
> 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
>