<div id="__MailbirdStyleContent" style="font-size: 10pt;font-family: Arial;color: #000000">
                                        
                                        
                                            
                                        
                                        
                                        <div><span style="font-family: Arial, Helvetica, sans-serif;font-size: 13px">> This happens automatically when "duplicate (all) control and alt keys" or "swap control and alt keys" is enabled.</span><br></div><div><br></div>Let me correct this. The preference "<span style="font-family: Arial, Helvetica, sans-serif;font-size: 13px">swap control and alt keys" does *not* map control keys to printable characters. Just swapping. I think we should rename "Duplicate (all) control and alt keys" to "Overwrite all control keys with alt/command keys".</span><div><span style="font-family: Arial, Helvetica, sans-serif;font-size: 13px"><br></span></div><div><span style="font-family: Arial, Helvetica, sans-serif;font-size: 13px">Sigh.</span></div><div><span style="font-family: Arial, Helvetica, sans-serif;font-size: 13px"><br></span></div><div><span style="font-family: Arial, Helvetica, sans-serif;font-size: 13px">Best,</span></div><div><span style="font-family: Arial, Helvetica, sans-serif;font-size: 13px">Marcel</span></div><div class="mb_sig"></div>
                                        
                                        <blockquote class="history_container" type="cite" style="border-left-style: solid;border-width: 1px;margin-top: 20px;margin-left: 0px;padding-left: 10px;min-width: 500px">
                        <p style="color: #AAAAAA; margin-top: 10px;">Am 13.12.2019 16:30:26 schrieb commits@source.squeak.org <commits@source.squeak.org>:</p><div style="font-family:Arial,Helvetica,sans-serif">A new version of Kernel was added to project The Inbox:<br>http://source.squeak.org/inbox/Kernel-mt.1287.mcz<br><br>==================== Summary ====================<br><br>Name: Kernel-mt.1287<br>Author: mt<br>Time: 13 December 2019, 4:30:11.846615 pm<br>UUID: 1e52cdbe-487d-ed47-8510-c491c1d57fca<br>Ancestors: Kernel-mt.1286<br><br>Proposal: Always map control characters to printable characters. This happens automatically when "duplicate (all) control and alt keys" or "swap control and alt keys" is enabled. But NOT when all of those preferences are disabled. Which can be surprising because when you type [ctrl]+[c], you expect a key value of 99 like in [cmd/alt]+[c]. ... and not 3 :-)<br><br>This is a proposal because we also would have to adapt and test:<br><br>TextEditor >> #dispatchOnKeyboardEvent:<br>TextEditor class >> #initializeShiftCmdKeyShortcuts<br>Editor class >> #specialShiftCmdKeys<br><br>=============== Diff against Kernel-mt.1286 ===============<br><br>Item was added:<br>+ ----- Method: EventSensor class>>installControlKeyEntryFor: (in category 'key decode table') -----<br>+ installControlKeyEntryFor: c<br>+  "Updates key-decode table. The table maps pairs of {character code . modifier code}. See the class comment for more information. Note that the bitmask 16r9F is used to convert control characters (ascii 0 to 31) to printable characters."<br>+ <br>+   | upper lower |<br>+      upper := c asUppercase asInteger.<br>+    lower := c asLowercase asInteger.<br>+    <br>+     KeyDecodeTable at: { lower bitAnd: 16r9F . 2 "ctrl" } put: { lower . 2 "ctrl"  }.<br>+        KeyDecodeTable at: { upper bitAnd: 16r9F . 2 bitOr: 1 "ctrl+shift" } put: { upper . 2 bitOr: 1 "ctrl+shift" }.<br>+ !<br><br>Item was changed:<br>  ----- Method: EventSensor class>>installKeyDecodeTable (in category 'class initialization') -----<br>  installKeyDecodeTable<br>      "Create a decode table that swaps some keys if <br>          Preferences swapControlAndAltKeys is set"<br>        KeyDecodeTable := Dictionary new.<br>+    <br>+     "In any case, translate all control characters to printable characters."<br>+   64 +1 "because 0 is special, see UTF32InputInterpreter"<br>+            to: 95 -2 "except for our mouse-wheel up/down hack"<br>+                do: [:keyCode | self installControlKeyEntryFor: keyCode asCharacter].<br>+ <br>     Preferences duplicateControlAndAltKeys <br>               ifTrue: [ self defaultCrossPlatformKeys do:<br>                           [ :c | self installDuplicateKeyEntryFor: c ] ].<br>       Preferences swapControlAndAltKeys <br>            ifTrue: [ self defaultCrossPlatformKeys do:<br>                           [ :c | self installSwappedKeyEntryFor: c ] ].<br>         Preferences duplicateAllControlAndAltKeys<br>             ifTrue: [ (Character allByteCharacters select: [:ea | ea isAlphaNumeric]) do:<br>                                 [ :c | self installDuplicateKeyEntryFor: c ] ].<br>  !<br><br><br></div></blockquote></div>