Pharo 5: Bug in removing key combinations

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

Pharo 5: Bug in removing key combinations

jfabry
Hi all,

Miguel and I found a bug in removing key combinations on a morph. Now they are global, while in Pharo 4 this was not the case. Consider the following code:

| morph |
morph := RubScrolledTextMorph new.

(morph textArea)
                removeKeyCombination: $s command;
                removeKeyCombination: $s control;
                on: $s command do: [morph flash ];
                on: $s control do: [morph flash ].
               
morph openInWorld.

In the morph, cmd-s will cause a flash, as expected. However in other windows (or browsers and playgrounds least) the original shortcut is lost, only a s character is added to the text field.

I did not see it on fogbugz so I would like to announce it here before I open a case, in case (heh) I missed it. So the question: is this a known bug?


---> Save our in-boxes! http://emailcharter.org <---

Johan Fabry   -   http://pleiad.cl/~jfabry
PLEIAD and RyCh labs  -  Computer Science Department (DCC)  -  University of Chile


Reply | Threaded
Open this post in threaded view
|

Re: Pharo 5: Bug in removing key combinations

Nicolai Hess-3-2


2015-12-28 19:07 GMT+01:00 Johan Fabry <[hidden email]>:
Hi all,

Miguel and I found a bug in removing key combinations on a morph. Now they are global, while in Pharo 4 this was not the case.

I was able to reproduce this on Pharo 4 as well, I think the main difference is that Pharo 5 uses Rubric for "Workspace/Playground" AND the Browser.
And in Pharo 4 these Tools use different Morphs.

 
Consider the following code:

| morph |
morph := RubScrolledTextMorph new.

(morph textArea)
                removeKeyCombination: $s command;
                removeKeyCombination: $s control;
                on: $s command do: [morph flash ];
                on: $s control do: [morph flash ].

morph openInWorld.

In the morph, cmd-s will cause a flash, as expected. However in other windows (or browsers and playgrounds least) the original shortcut is lost, only a s character is added to the text field.

For me, the "morph flash" wasn't working on the RubRricTextMorph, unitil I opened a Transcript and enabled KeyLog setDebug. Only after this the morph was actually flashing (or the flashing wasn't visible?).
 

I did not see it on fogbugz so I would like to announce it here before I open a case, in case (heh) I missed it. So the question: is this a known bug?

No, I think this bug is not yet reported.
 


---> Save our in-boxes! http://emailcharter.org <---

Johan Fabry   -   http://pleiad.cl/~jfabry
PLEIAD and RyCh labs  -  Computer Science Department (DCC)  -  University of Chile



Reply | Threaded
Open this post in threaded view
|

Re: Pharo 5: Bug in removing key combinations

jfabry
Thanks Nicolai for having a look! I added a bug report and notified you since you seem to be knowledgeable of the key shortcut system.


On Dec 29, 2015, at 09:51, Nicolai Hess <[hidden email]> wrote:



2015-12-28 19:07 GMT+01:00 Johan Fabry <[hidden email]>:
Hi all,

Miguel and I found a bug in removing key combinations on a morph. Now they are global, while in Pharo 4 this was not the case.

I was able to reproduce this on Pharo 4 as well, I think the main difference is that Pharo 5 uses Rubric for "Workspace/Playground" AND the Browser.
And in Pharo 4 these Tools use different Morphs.

 
Consider the following code:

| morph |
morph := RubScrolledTextMorph new.

(morph textArea)
                removeKeyCombination: $s command;
                removeKeyCombination: $s control;
                on: $s command do: [morph flash ];
                on: $s control do: [morph flash ].

morph openInWorld.

In the morph, cmd-s will cause a flash, as expected. However in other windows (or browsers and playgrounds least) the original shortcut is lost, only a s character is added to the text field.

For me, the "morph flash" wasn't working on the RubRricTextMorph, unitil I opened a Transcript and enabled KeyLog setDebug. Only after this the morph was actually flashing (or the flashing wasn't visible?).
 

I did not see it on fogbugz so I would like to announce it here before I open a case, in case (heh) I missed it. So the question: is this a known bug?

No, I think this bug is not yet reported.
 


---> Save our in-boxes! http://emailcharter.org <---

Johan Fabry   -   http://pleiad.cl/~jfabry
PLEIAD and RyCh labs  -  Computer Science Department (DCC)  -  University of Chile



---> Save our in-boxes! http://emailcharter.org <---

Johan Fabry   -   http://pleiad.cl/~jfabry
PLEIAD and RyCh labs  -  Computer Science Department (DCC)  -  University of Chile

Reply | Threaded
Open this post in threaded view
|

Re: Pharo 5: Bug in removing key combinations

Nicolai Hess-3-2


2015-12-29 14:13 GMT+01:00 Johan Fabry <[hidden email]>:
Thanks Nicolai for having a look! I added a bug report and notified you since you seem to be knowledgeable of the key shortcut system.



I think the problem is that this morph, does not have a direct keymap. If it can not find a direct keymap, it searches
all keymap categories used by this morph and removes the shortcut for this category, and this category keymap is shared
by all RubEditingAreas.

(I don't know if this is a bug, but I would say, the call to #removeKeyCombination: on the morph, should only remove direct keymap entries, not
those defined for the keymap category).

If you just want to redefine some shortcuts (like in this example), it isn't necessary to remove the defined (category-shortcuts) but just
add the new ones:


| morph |
morph := RubScrolledTextMorph new.

(morph textArea)
    on: $s command do: [42 inspect ];
    on: $s control do: [42 inspect ].
        
morph openInWorld.



 
On Dec 29, 2015, at 09:51, Nicolai Hess <[hidden email]> wrote:



2015-12-28 19:07 GMT+01:00 Johan Fabry <[hidden email]>:
Hi all,

Miguel and I found a bug in removing key combinations on a morph. Now they are global, while in Pharo 4 this was not the case.

I was able to reproduce this on Pharo 4 as well, I think the main difference is that Pharo 5 uses Rubric for "Workspace/Playground" AND the Browser.
And in Pharo 4 these Tools use different Morphs.

 
Consider the following code:

| morph |
morph := RubScrolledTextMorph new.

(morph textArea)
                removeKeyCombination: $s command;
                removeKeyCombination: $s control;
                on: $s command do: [morph flash ];
                on: $s control do: [morph flash ].

morph openInWorld.

In the morph, cmd-s will cause a flash, as expected. However in other windows (or browsers and playgrounds least) the original shortcut is lost, only a s character is added to the text field.

For me, the "morph flash" wasn't working on the RubRricTextMorph, unitil I opened a Transcript and enabled KeyLog setDebug. Only after this the morph was actually flashing (or the flashing wasn't visible?).
 

I did not see it on fogbugz so I would like to announce it here before I open a case, in case (heh) I missed it. So the question: is this a known bug?

No, I think this bug is not yet reported.
 


---> Save our in-boxes! http://emailcharter.org <---

Johan Fabry   -   http://pleiad.cl/~jfabry
PLEIAD and RyCh labs  -  Computer Science Department (DCC)  -  University of Chile



---> Save our in-boxes! http://emailcharter.org <---

Johan Fabry   -   http://pleiad.cl/~jfabry
PLEIAD and RyCh labs  -  Computer Science Department (DCC)  -  University of Chile


Reply | Threaded
Open this post in threaded view
|

Re: Pharo 5: Bug in removing key combinations

jfabry

Great, that solves the problem I was having. Thanks a lot!

On Dec 29, 2015, at 20:36, Nicolai Hess <[hidden email]> wrote:

If you just want to redefine some shortcuts (like in this example), it isn't necessary to remove the defined (category-shortcuts) but just 
add the new ones:


| morph |
morph := RubScrolledTextMorph new.

(morph textArea)
    on: $s command do: [42 inspect ];
    on: $s control do: [42 inspect ].
        
morph openInWorld.



---> Save our in-boxes! http://emailcharter.org <---

Johan Fabry   -   http://pleiad.cl/~jfabry
PLEIAD and RyCh labs  -  Computer Science Department (DCC)  -  University of Chile

Reply | Threaded
Open this post in threaded view
|

Re: Pharo 5: Bug in removing key combinations

Tudor Girba-2
In reply to this post by Nicolai Hess-3-2
Hi,

That is why I think the mechanism of categories per morph type is too complicated. Instead, I would prefer to only have instance side keybindings that can be installed during the instantiation.

Cheers,
Doru


> On Dec 30, 2015, at 1:36 AM, Nicolai Hess <[hidden email]> wrote:
>
>
>
> 2015-12-29 14:13 GMT+01:00 Johan Fabry <[hidden email]>:
> Thanks Nicolai for having a look! I added a bug report and notified you since you seem to be knowledgeable of the key shortcut system.
>
> In any case, URL to the bug report is https://pharo.fogbugz.com/f/cases/17304/Morph-removeKeyCombination-removes-shortcut-key-globally-instead-of-locally
>
>
> I think the problem is that this morph, does not have a direct keymap. If it can not find a direct keymap, it searches
> all keymap categories used by this morph and removes the shortcut for this category, and this category keymap is shared
> by all RubEditingAreas.
>
> (I don't know if this is a bug, but I would say, the call to #removeKeyCombination: on the morph, should only remove direct keymap entries, not
> those defined for the keymap category).
>
> If you just want to redefine some shortcuts (like in this example), it isn't necessary to remove the defined (category-shortcuts) but just
> add the new ones:
>
>
> | morph |
> morph := RubScrolledTextMorph new.
>
> (morph textArea)
>     on: $s command do: [42 inspect ];
>     on: $s control do: [42 inspect ].
>        
> morph openInWorld.
>
>
>
>  
>> On Dec 29, 2015, at 09:51, Nicolai Hess <[hidden email]> wrote:
>>
>>
>>
>> 2015-12-28 19:07 GMT+01:00 Johan Fabry <[hidden email]>:
>> Hi all,
>>
>> Miguel and I found a bug in removing key combinations on a morph. Now they are global, while in Pharo 4 this was not the case.
>>
>> I was able to reproduce this on Pharo 4 as well, I think the main difference is that Pharo 5 uses Rubric for "Workspace/Playground" AND the Browser.
>> And in Pharo 4 these Tools use different Morphs.
>>
>>  
>> Consider the following code:
>>
>> | morph |
>> morph := RubScrolledTextMorph new.
>>
>> (morph textArea)
>>                 removeKeyCombination: $s command;
>>                 removeKeyCombination: $s control;
>>                 on: $s command do: [morph flash ];
>>                 on: $s control do: [morph flash ].
>>
>> morph openInWorld.
>>
>> In the morph, cmd-s will cause a flash, as expected. However in other windows (or browsers and playgrounds least) the original shortcut is lost, only a s character is added to the text field.
>>
>> For me, the "morph flash" wasn't working on the RubRricTextMorph, unitil I opened a Transcript and enabled KeyLog setDebug. Only after this the morph was actually flashing (or the flashing wasn't visible?).
>>  
>>
>> I did not see it on fogbugz so I would like to announce it here before I open a case, in case (heh) I missed it. So the question: is this a known bug?
>>
>> No, I think this bug is not yet reported.
>>  
>>
>>
>> ---> Save our in-boxes! http://emailcharter.org <---
>>
>> Johan Fabry   -   http://pleiad.cl/~jfabry
>> PLEIAD and RyCh labs  -  Computer Science Department (DCC)  -  University of Chile
>
>
>
> ---> Save our in-boxes! http://emailcharter.org <---
>
> Johan Fabry   -   http://pleiad.cl/~jfabry
> PLEIAD and RyCh labs  -  Computer Science Department (DCC)  -  University of Chile
>
>

--
www.tudorgirba.com
www.feenk.com

"It's not what we do that matters most, it's how we do it."