Cmd+s in P8 not captured using Commander (works in P9) and SpTextPresenter

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

Cmd+s in P8 not captured using Commander (works in P9) and SpTextPresenter

hernanmd
I found a difference in shortcut handling between Pharo 8 and Pharo 9 which you can reproduce with the attached minimum working example. In the example, the halt in the Command's #execute method in P9 is sent but not in P8.

SpComm2SaveTextMWE show.

The problem seems to be Pharo 8 doesn't execute the KMKeymap callback configured for Cmd+s in SpKMCategoryBuilder>>visitCommand: while Pharo 9 does.

In some way the only way to capture the Accept keypress is to modify the #buildShortcutsOn: method in RubTextEditor, but I'd like to avoid such approach.

Is there any workaround to this?

Cheers,

Hernán


SpComm2SaveTextMWE.st (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Cmd+s in P8 not captured using Commander (works in P9) and SpTextPresenter

hernanmd
For the record, a workaround is to send #whenTextIsAcceptedDo: to the SpTextPresenter.

Cheers,

Hernán

El jue., 30 jul. 2020 a las 0:10, Hernán Morales Durand (<[hidden email]>) escribió:
I found a difference in shortcut handling between Pharo 8 and Pharo 9 which you can reproduce with the attached minimum working example. In the example, the halt in the Command's #execute method in P9 is sent but not in P8.

SpComm2SaveTextMWE show.

The problem seems to be Pharo 8 doesn't execute the KMKeymap callback configured for Cmd+s in SpKMCategoryBuilder>>visitCommand: while Pharo 9 does.

In some way the only way to capture the Accept keypress is to modify the #buildShortcutsOn: method in RubTextEditor, but I'd like to avoid such approach.

Is there any workaround to this?

Cheers,

Hernán

Reply | Threaded
Open this post in threaded view
|

Re: Cmd+s in P8 not captured using Commander (works in P9) and SpTextPresenter

Stéphane Ducasse
In reply to this post by hernanmd
Can you open a bug entry with your solution?
Like that I can point it to steven.

tx

On 30 Jul 2020, at 05:10, Hernán Morales Durand <[hidden email]> wrote:

I found a difference in shortcut handling between Pharo 8 and Pharo 9 which you can reproduce with the attached minimum working example. In the example, the halt in the Command's #execute method in P9 is sent but not in P8.

SpComm2SaveTextMWE show.

The problem seems to be Pharo 8 doesn't execute the KMKeymap callback configured for Cmd+s in SpKMCategoryBuilder>>visitCommand: while Pharo 9 does.

In some way the only way to capture the Accept keypress is to modify the #buildShortcutsOn: method in RubTextEditor, but I'd like to avoid such approach.

Is there any workaround to this?

Cheers,

Hernán

<SpComm2SaveTextMWE.st>

--------------------------------------------
Stéphane Ducasse
03 59 35 87 52
Assistant: Aurore Dalle 
FAX 03 59 57 78 50
TEL 03 59 35 86 16
S. Ducasse - Inria
40, avenue Halley, 
Parc Scientifique de la Haute Borne, Bât.A, Park Plaza
Villeneuve d'Ascq 59650
France