<p>See <a class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="448912894" data-permission-text="Issue title is private" data-url="https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/396" data-hovercard-type="issue" data-hovercard-url="/OpenSmalltalk/opensmalltalk-vm/issues/396/hovercard" href="https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/396">#396</a>, <a class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="537558299" data-permission-text="Issue title is private" data-url="https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/454" data-hovercard-type="issue" data-hovercard-url="/OpenSmalltalk/opensmalltalk-vm/issues/454/hovercard" href="https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/454">#454</a>, and <a class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="172090082" data-permission-text="Issue title is private" data-url="https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/42" data-hovercard-type="issue" data-hovercard-url="/OpenSmalltalk/opensmalltalk-vm/issues/42/hovercard" href="https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/42">#42</a>. Maybe also <a class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="172094290" data-permission-text="Issue title is private" data-url="https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/43" data-hovercard-type="issue" data-hovercard-url="/OpenSmalltalk/opensmalltalk-vm/issues/43/hovercard" href="https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/43">#43</a>.</p>
<p>I investigated the differences in the low-level event array sent by the VM to the image for relevant CTRL-key combinations.</p>
<p>For key-character events, that array is structured as follows:</p>
<div class="highlight highlight-source-smalltalk"><pre>{
   <span class="pl-c1">2</span> <span class="pl-c"><span class="pl-c">"</span>type for keyboard event<span class="pl-c">"</span></span>
   <span class="pl-c1">293847</span> <span class="pl-c"><span class="pl-c">"</span>timestamp<span class="pl-c">"</span></span>
   ... <span class="pl-c"><span class="pl-c">"</span>character code ASCII<span class="pl-c">"</span></span>
   <span class="pl-c1">0</span> <span class="pl-c"><span class="pl-c">"</span>key character, not key down or key up<span class="pl-c">"</span></span>
   <span class="pl-c1">2</span> <span class="pl-c"><span class="pl-c">"</span>ctrl key as modifier pressed only<span class="pl-c">"</span></span>
   ... <span class="pl-c"><span class="pl-c">"</span>character code as Unicode<span class="pl-c">"</span></span>
   <span class="pl-c1">0</span> <span class="pl-c"><span class="pl-c">"</span>reserved<span class="pl-c">"</span></span>
   <span class="pl-c1">1</span> <span class="pl-c"><span class="pl-c">"</span>host window number 1<span class="pl-c">"</span></span>
}</pre></div>
<p>So, please focus on those character codes.</p>
<hr>
<p><strong>Windows 10</strong> (Version 1909)<br>
cog.spur 201911282316<br>
Squeak 5.3beta 19276<br>
Image format 6521 (32 bit)</p>
<pre><code>mouse wheel up
#(2 91706953 30 0 2 0 0 1)
mouse wheel down
#(2 91731109 31 0 2 0 0 1)

ctrl + up
#(2 91746671 30 0 2 30 0 1)
ctrl + down
#(2 91778531 31 0 2 31 0 1)

ctrl + c
#(2 91802453 3 0 2 3 0 1)
</code></pre>
<p><em>Result:</em> Our mouse-wheel hack does not set the Unicode character. Only the ASCII character.</p>
<hr>
<p><strong>Debian 10</strong> (Gnome, X11)<br>
cog.spur 201911282316<br>
Squeak 5.3beta 19276<br>
Image format 68021 (64 bit)</p>
<pre><code>mouse wheel up
#(2 109872 30 0 15 30 0 1)
mouse wheel down
#(2 109923 31 0 15 31 0 1)

ctrl + up
#(2 212175 30 0 2 30 0 1)
ctrl + down
#(2 249663 31 0 2 31 0 1)

ctrl + c
#(2 184765 99 0 2 99 0 1)
</code></pre>
<p><em>Result:</em> Our mouse-wheel hack raises all modifier keys as pressed. Not just the CTRL key. Also, the ASCII control characters are not considered. See <a href="https://en.wikipedia.org/wiki/Control_character" rel="nofollow">https://en.wikipedia.org/wiki/Control_character</a>.</p>
<hr>
<p><strong>macOS Sierra</strong> (10.12.6)<br>
cog.spur 201911282316<br>
Squeak 5.3beta 19276<br>
Image format 68021 (64 bit)</p>
<pre><code>mouse wheel up
#(2 57855 30 0 15 30 0 1)
mouse wheel down
#(2 84690 31 0 15 31 0 1)

ctrl + up
#(2 290999 30 0 2 30 0 1)
ctrl + down
#(2 322197 31 0 2 31 0 1)

ctrl + c
#(2 337191 3 0 2 3 0 1)
</code></pre>
<p><em>Result:</em> Our mouse-wheel hack raises all modifier keys as pressed. Not just the CTRL key.</p>
<hr>
<p><strong>Implications for the image side:</strong> We cannot consistently (or easily or without magic) duplicate or swap or unpack character codes via <code>KeyDecodeTable</code> in <code>EventSensor >> #processEvent:</code> because:</p>
<ul>
<li>The Linux platform does not transport control characters to the image.</li>
<li>The Windows platform omits to set Unicode for mouse-wheel events.</li>
</ul>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/456?email_source=notifications&email_token=AIJPEW6YUE6VZJTGNMUR6T3QZCPY7A5CNFSM4J3Y2YXKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4IA746WA">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AIJPEW5WC3S2PMETRB2B26LQZCPY7ANCNFSM4J3Y2YXA">unsubscribe</a>.<img src="https://github.com/notifications/beacon/AIJPEW3HBZMBQYSHBWGVTY3QZCPY7A5CNFSM4J3Y2YXKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4IA746WA.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/456?email_source=notifications\u0026email_token=AIJPEW6YUE6VZJTGNMUR6T3QZCPY7A5CNFSM4J3Y2YXKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4IA746WA",
"url": "https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/456?email_source=notifications\u0026email_token=AIJPEW6YUE6VZJTGNMUR6T3QZCPY7A5CNFSM4J3Y2YXKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4IA746WA",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>