Control key instead of Shift+Alt broken (Re: [squeak-dev] The shiftEnclose: horror show)

Nicolas Cellier nicolas.cellier.aka.nice at gmail.com
Tue Aug 9 10:27:21 UTC 2011


2011/8/9 Chris Muller <asqueaker at gmail.com>:
> In Linux, it used to be, I could type Control in lieu of Shift+Alt.
> For example, I used to type Control+( to surround with parentheses.
> Control+[ to surround with curly-braces {}.
>
> Now I have to type Alt+Shift+( and Alt+Shift+[ for those.
>
> Is there any way to get the Control+( back?
>
>  - Chris
>

Interesting feedback...
The #shiftEnclose: change should affect only the case when SHIFT is
pressed. (except the case of ,).
But maybe there is another layer of hack to map the CONTROL key to
something else ?
Or is it another change which broke this feature ?

Could you revert the #shiftEnclose: change, apply (Editor initialize)
and report the result ?
Could you report the result of (Sensor kbdTest) in Transcript for
various key combinations ? (escape the test by typing x)

Thanks for helping

Nicolas

> On Thu, Aug 4, 2011 at 3:15 AM, Nicolas Cellier
> <nicolas.cellier.aka.nice at gmail.com> wrote:
>> I'm typing this message on a mac French keyboard.
>> That means I can obtain the holy brackets [ | ] only through weird
>> keystroke combinations
>> | = shit+option+L
>> [ = shift+option+( where shift+5 is (
>>
>> Enclosing a text in square brackets would require some finger torture
>> both in Squeak/Pharo
>> shift+option+command+(
>> But this does not work because of #shiftEnclose: rules encountered in
>> #initializeShiftCmdKeyShortcuts
>> (found both ParagraphEditor class and TextEditor class)
>>
>>        "Note: Command key overrides shift key, so, for example, cmd-shift-9
>> produces $9 not $("
>>        '9[,''' do: [ :char | cmdMap at: (char asciiValue + 1) put:
>> #shiftEnclose: ].       "({< and double-quote"
>>        "Note: Must use cmd-9 or ctrl-9 to get '()' since cmd-shift-9 is a
>> Mac FKey command."
>>
>> shiftEnclose: is badly designed because it does hardcode the keyboard
>> layout (see below).
>> This is not compatible with modern VMs, at least the mac ones, because
>> they deliver a unicode codePoint for $[ or $|, not a raw keycode.
>> It's easy to remove this anachronism and correct the mapping:
>>
>>        "On some keyboards, these characters require a shift"
>>        '([<{|"''' do: [:char | cmdMap at: char asciiValue + 1 put: #enclose:].
>>
>> To avoid pushing a mac-centric change in trunk, I need to know if the
>> Linux/Windows VM would support above modification.
>> Can anyone check for me ?
>>
>> Nicolas
>>
>>
>>
>>
>>
>> Example of hardcoded keyboard layout:
>> TextEditor>>shiftEnclose: aKeyboardEvent
>>        "Insert or remove bracket characters around the current selection.
>>         Flushes typeahead."
>>
>>        | char left right startIndex stopIndex oldSelection which text |
>>        char := aKeyboardEvent keyCharacter.
>>        char = $9 ifTrue: [ char := $( ].
>>        char = $, ifTrue: [ char := $< ].
>>        char = $[ ifTrue: [ char := ${ ].
>>        char = $' ifTrue: [ char := $" ].
>>        char asciiValue = 27 ifTrue: [ char := ${ ].    "ctrl-["
>> snip...
>>
>>
>
>



More information about the Squeak-dev mailing list