<div dir="ltr"><div dir="ltr"><div>Hi Marcel,</div><br><div>Since Squeak is Mac oriented, it understands cmd+c = copy, cmd+v = paste, etc... (alt+c alt+v on windows).</div><div>IMO, the purpose of #duplicateAllControlAndAltKeys is mainly to let windows users type ctrl+key in accordance to platform feel.</div><div>ctrl+c = copy, ctrl+v = paste, etc...</div><div><br></div></div><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le lun. 23 déc. 2019 à 11:24, <<a href="mailto:commits@source.squeak.org" target="_blank">commits@source.squeak.org</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Marcel Taeumel uploaded a new version of Kernel to project The Trunk:<br>
<a href="http://source.squeak.org/trunk/Kernel-mt.1290.mcz" rel="noreferrer" target="_blank">http://source.squeak.org/trunk/Kernel-mt.1290.mcz</a><br>
<br>
==================== Summary ====================<br>
<br>
Name: Kernel-mt.1290<br>
Author: mt<br>
Time: 23 December 2019, 11:24:23.728349 am<br>
UUID: b2e649ef-ad9d-5040-b6b0-70b7e29e4085<br>
Ancestors: Kernel-mt.1289<br>
<br>
Do actually *duplicate* CTRL and CMD/ALT keys if that preference is enabled.<br>
<br>
This means that such key-stroke events will always answer TRUE to both #controlKeyPressed and #commandKeyPressed. This solves various issues in client code. Now all paths that only check for #controlKeyPressed will match even if the duplication preference is enabled.<br>
<br>
Note that for applications that do want to make use of CTRL and ALT/CMD in separate ways, the PREFERENCE "duplicate (all) ctrl and alt keys" has to be DISABLED. Those applications can easily check and inform the user.<br>
<br>
Also note that key duplication means that there is no way to detect actual control keys. Disable that preference if you want to hit CTRL+C and, for example, access "Character enter" (ASCII 3) for that event's #keyCharacter.<br>
<br>
Finally note that I will double-check effects in TextEditor asap.<br>
<br>
=============== Diff against Kernel-mt.1289 ===============<br>
<br>
Item was changed:<br>
  ----- Method: EventSensor class>>installDuplicateKeyEntryFor: (in category 'key decode table') -----<br>
  installDuplicateKeyEntryFor: aPrintableCharacter<br>
        "Updates the key-decode table, which maps between pairs of {character code . modifier code}. See the class comment for more information.<br>
        Note that the bitmask 16r9F removes the high bits, which subtracts 64 from the key code for (upper) $A to $Z and 96 for (lower) $a to $z. The VM sends non-printable control characters for [ctrl]+[A-Za-Z] in ASCII < 32, but the given character is expected to be ASCII >= 32 and thus printable. So we have to convert printable characters to control characters in this mapping table."<br>
<br>
        | upper lower |<br>
        upper := aPrintableCharacter asUppercase asInteger.<br>
        lower := aPrintableCharacter asLowercase asInteger.<br>
<br>
+       KeyDecodeTable at: { lower bitAnd: 16r9F . 2 "ctrl" } put: { lower . 2 bitOr: 8 "ctrl + cmd/alt" }.<br>
+       KeyDecodeTable at: { upper bitAnd: 16r9F . 2 bitOr: 1 "ctrl + shift" } put: { upper . (2 bitOr: 8) bitOr: 1 "ctrl + cmd/alt + shift" }.<br>
+       KeyDecodeTable at: { lower . 8 "cmd/alt" } put: { lower . 8 bitOr: 2 "cmd/alt + ctrl" }.<br></blockquote><div>Due to this, cmd+7 never makes it way to TextEditor...</div><div>Since it now has controlKeyPressed, it is captured by/interpreted as DockingBarMorph menu #7.</div><div><br></div><div>IMO, this is too late in the release cycle to introduce such changes, given current code base complexity, it's too difficult to predict consequences.<br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
+       KeyDecodeTable at: { upper . 8 bitOr: 1 "cmd/alt + shift" } put: { upper . (8 bitOr: 2) bitOr: 1 "cmd/alt + ctrl + shift" }.<br>
-       KeyDecodeTable at: { lower bitAnd: 16r9F . 2 "ctrl" } put: { lower . 8 "cmd/alt" }.<br>
-       KeyDecodeTable at: { upper bitAnd: 16r9F . 2 bitOr: 1 "ctrl+shift" } put: { upper . 8 bitOr: 1 "cmd/alt+shift" }.<br>
<br>
        "For Unix/Linux VMs as of version 201911282316, no control characters will be sent from the VM. Avoid check for #platformName because the extra mapping will not affect others anyway."<br>
        self flag: #unixOnly.<br>
+       KeyDecodeTable at: { lower . 2 "ctrl" } put: { lower . 2 bitOr: 8 "ctrl + cmd/alt" }.<br>
+       KeyDecodeTable at: { upper . 2 bitOr: 1 "ctrl + shift" } put: { upper . (2 bitOr: 8) bitOr: 1 "ctrl + cmd/alt + shift" }.!<br>
-       KeyDecodeTable at: { lower . 2 "ctrl" } put: { lower . 8 "cmd/alt" }.<br>
-       KeyDecodeTable at: { upper . 2 bitOr: 1 "ctrl+shift" } put: { upper . 8 bitOr: 1 "cmd/alt+shift" }.!<br>
<br>
<br>
</blockquote></div>
</div>