keymappings question

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

keymappings question

Tudor Girba-2
Hi,

I wanted to play with Keymappings, but I got stuck right at the start :).

I have two problems:

1. I would like to add a simple shortcut (e.g., "$o command") to a text morph instance. So I have:

textMorph := TextMorph new contents: 'abcdefgh'.
"what is the magic invocation here ?"
textMorph openInWindow

The question is what should I write in the second line?


2. I would like to disable existing shortcuts from the text morph. How should I do that?


Cheers,
Doru

--
www.tudorgirba.com

"What we can governs what we wish."




_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: keymappings question

Tudor Girba-2
Hi,

Ahh, I thought that the latest version of Keymappings handles shortcuts per morph instance. It looks like it does not, and this is bad news for me :(.

I want to use them in the context of Glamour and for that I need to control the shortcuts of morph instances.

How difficult is it to get it working?

Cheers,
Doru


On 12 Jul 2011, at 01:04, Guillermo Polito wrote:

>
>
> On Mon, Jul 11, 2011 at 6:24 PM, Tudor Girba <[hidden email]> wrote:
> Hi,
>
> I wanted to play with Keymappings, but I got stuck right at the start :).
>
> I have two problems:
>
> 1. I would like to add a simple shortcut (e.g., "$o command") to a text morph instance. So I have:
>
> textMorph := TextMorph new contents: 'abcdefgh'.
> "what is the magic invocation here ?"
> textMorph openInWindow
>
> The shortcuts are defined via the keymapping pragma.  A shortcut is attached by now to a particular class and not just an instance.  Look at the examples (the ones defined by Camillo, Laurent or me) and tell me if they are understandable, hehe.
>  
>
> The question is what should I write in the second line?
>
> Nothing.  Keymappings are "static" right now.
>  
>
>
> 2. I would like to disable existing shortcuts from the text morph. How should I do that?
>
> Look at where the shortcuts are defined for TextMorph and remove the declarations.  And you shold also reset the KMRepository.
>
> But removing keymapping declarations doesn't guarantee the removal in TextMorph since the default -old- shortcut handling is still there.  Keymapping is just intercepting them by now.
>
> Hope this helps,
> Guille
>  
>
>
> Cheers,
> Doru
>
> --
> www.tudorgirba.com
>
> "What we can governs what we wish."
>
>
>
>

--
www.tudorgirba.com

"Value is always contextual."




_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev