BUG in keyboard sequence for commenting region ?

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

BUG in keyboard sequence for commenting region ?

Nicola Mingotti
Hi,

I am using Squeak5.2, in MacOS.

According to Help -> Keyboard Shortcut:
----
Ctrl-' Toggle enclosure within double-quotes
Cmd-' Toggle enclosure within single-quotes
----

Neither of those works. The only way to make a selected part of text commented is to press Shift+' . This sequence does not toggle, it just quotes the region.

I may have installed a nasty package because I am pretty sure I was able to comment/uncomment regions a few days ago.

Do you observe the same behavior ?

Post Scriptum: Can you tell me where this is implemented and save me X hours of digging ? :) I would like to change it a bit.

Bye
Nicola
_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: BUG in keyboard sequence for commenting region ?

K K Subbu
On 05/08/19 9:30 AM, Nicola Mingotti wrote:

> I am using Squeak5.2, in MacOS.
>
> According to Help -> Keyboard Shortcut:
> ----
> Ctrl-' Toggle enclosure within double-quotes
> Cmd-' Toggle enclosure within single-quotes
> ----
>
> Neither of those works. The only way to make a selected part of text
> commented is to press Shift+' . This sequence does not toggle, it
> just quotes the region.
>
> I may have installed a nasty package because I am pretty sure I was
> able to comment/uncomment regions a few days ago.
>
> Do you observe the same behavior ?

I am unable to reproduce this in Squeak 5.2-18231 (Linux 64b). Alt-'
(Alt in Linux = Cmd key in Mac) works as expected. Ctrl-' is treated
like alt-shift-' (alt-").

> Post Scriptum: Can you tell me where this is implemented and save m
> X hours of digging ?:)  I would like to change it a bit.

TextEditor>>enclose: handles this action. This method is invoked from a
lookup table cmdMap initialized in TextEditor
class>>initializeCmdKeyShortcuts.

BTW, you may want to keep the following code snippets handy in a
workspace to debug keyboard events:

HandMorph showEvents: true
HandMorph showEvents: false

HTH .. Subbu
_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: BUG in keyboard sequence for commenting region ?

Nicola Mingotti


Thank you Subbu, I see the table where the shortcuts are defined, nice ! 

bye
n.

On 8/4/19 10:55 PM, K K Subbu wrote:
On 05/08/19 9:30 AM, Nicola Mingotti wrote:
I am using Squeak5.2, in MacOS.

According to Help -> Keyboard Shortcut:
----
Ctrl-'    Toggle enclosure within double-quotes
Cmd-'    Toggle enclosure within single-quotes
----

Neither of those works. The only way to make a selected part of text
commented is to press Shift+' . This sequence does not toggle, it
just quotes the region.

I may have installed a nasty package because I am pretty sure I was
able to comment/uncomment regions a few days ago.

Do you observe the same behavior ?

I am unable to reproduce this in Squeak 5.2-18231 (Linux 64b). Alt-' (Alt in Linux = Cmd key in Mac) works as expected. Ctrl-' is treated like alt-shift-' (alt-").

Post Scriptum: Can you tell me where this is implemented and save m
X hours of digging ?:)  I would like to change it a bit.

TextEditor>>enclose: handles this action. This method is invoked from a lookup table cmdMap initialized in TextEditor class>>initializeCmdKeyShortcuts.

BTW, you may want to keep the following code snippets handy in a workspace to debug keyboard events:

HandMorph showEvents: true
HandMorph showEvents: false

HTH .. Subbu


_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Fwd: BUG in keyboard sequence for commenting region ?

Christoph Thiede
In reply to this post by K K Subbu

Hi,


I think this could be a bug in TextEditor>>#enclose:. On a Qwerty keyboard, everything might work as expected. But for example on a Qwertz keyboard, none of '{}|"<>' is entered by holding shift and pressing one of the keys for '[]\'',.'.


But I do not really understand this method fully: When is this shift transformation ever used? At least in my image (running on Win10), KeyboardEvent>>#keyCharacter always respects the shift state and directly returns $( or similar values. Disabling this section does not appear to change any observable behavior. Is this OS specific or even keyboard layout specific, or is #enclose: out of date?


In case the section is still relevant: Does Squeak currently has any logic regarding the local keyboard layout? If not, a simple approach might be to introduce a keyboard layout preference and to define a default dictionary for these shift replacements per keyboard layout.


Looking forward to your answers :)

Best,

Christoph



Von: Beginners <[hidden email]> im Auftrag von K K Subbu <[hidden email]>
Gesendet: Montag, 5. August 2019 07:55 Uhr
An: A friendly place to get answers to even the most basic questions about Squeak.; Nicola Mingotti
Betreff: Re: [Newbies] BUG in keyboard sequence for commenting region ?
 
On 05/08/19 9:30 AM, Nicola Mingotti wrote:
> I am using Squeak5.2, in MacOS.
>
> According to Help -> Keyboard Shortcut:
> ----
> Ctrl-'        Toggle enclosure within double-quotes
> Cmd-' Toggle enclosure within single-quotes
> ----
>
> Neither of those works. The only way to make a selected part of text
> commented is to press Shift+' . This sequence does not toggle, it
> just quotes the region.
>
> I may have installed a nasty package because I am pretty sure I was
> able to comment/uncomment regions a few days ago.
>
> Do you observe the same behavior ?

I am unable to reproduce this in Squeak 5.2-18231 (Linux 64b). Alt-'
(Alt in Linux = Cmd key in Mac) works as expected. Ctrl-' is treated
like alt-shift-' (alt-").

> Post Scriptum: Can you tell me where this is implemented and save m
> X hours of digging ?:)  I would like to change it a bit.

TextEditor>>enclose: handles this action. This method is invoked from a
lookup table cmdMap initialized in TextEditor
class>>initializeCmdKeyShortcuts.

BTW, you may want to keep the following code snippets handy in a
workspace to debug keyboard events:

HandMorph showEvents: true
HandMorph showEvents: false

HTH .. Subbu
_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners

_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Carpe Squeak!