<div id="__MailbirdStyleContent" style="font-size: 10pt;font-family: Arial;color: #000000;text-align: left" dir="ltr">
                                        Thanks! :-) I see. Did not notice that. :-D<div><br></div><div>Tom and I want to be brave and take a quick look at the X11 Input Plugin, too.</div><div><br></div><div>From a first glance, the bug is in this (repeated) pattern:</div><div><pre class="c-mrkdwn__pre" data-stringify-type="pre" style="box-sizing: inherit;margin-top: 4px;margin-bottom: 4px;padding: 8px;--saf-0: rgba(var(--sk_foreground_low,29,28,29),0.13);font-size: 12px;line-height: 1.50001;font-variant-ligatures: none;overflow-wrap: break-word;word-break: normal;tab-size: 4;border: 1px solid var(--saf-0);border-radius: 4px;background: rgba(var(--sk_foreground_min,29,28,29),0.04);counter-reset: list-0 0 list-1 0 list-2 0 list-3 0 list-4 0 list-5 0 list-6 0 list-7 0 list-8 0 list-9 0;color: rgb(29, 28, 29);font-family: Monaco, Menlo, Consolas, "Courier New", monospace !important">...<br style="box-sizing: inherit;">recordKeyboardEvent(0, EventKeyDown, modifierState, utf32);<br style="box-sizing: inherit;">recordKeyboardEvent(0, EventKeyChar, modifierState, utf32);<br style="box-sizing: inherit;">...</pre></div><div><br></div><div>If we can hunt down something like a "scanCode" for "EventKeyDown", it might work. Maybe I am overlooking some X11 basics here.</div><div><br></div><div>Best,</div><div>Marcel</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 15.05.2021 17:17:18 schrieb David T. Lewis <lewis@mail.msen.com>:</p><div style="font-family:Arial,Helvetica,sans-serif">Hi Marcel,
<br>
<br>Attached are changes that should make the virtual key mapping work
<br>when the image is restarted on a different platform.
<br>
<br>Dave
<br>
<br>
<br>On Wed, Apr 28, 2021 at 12:02:44PM +0200, Marcel Taeumel wrote:
<br>> Hi all!
<br>> 
<br>> Here is a small update. Please find attached the changeset.
<br>> 
<br>> Updates:
<br>> - Adds KeyboardEvent >> #keyCode (via new inst-var)
<br>> - Logs the last key-down event to attach virtual-key codes to key-stroke events; see HandMorph >> #generateKeyboardEvent:
<br>> - Simplifies KeyboardEvent >> #key
<br>> - Show event repetition in KeyboardExecizer
<br>> 
<br>> 
<br>> 
<br>> Major questions:
<br>> 1. Does it work on your machine?
<br>> 2. What are your thoughts on KeyboardEvent >> #key?
<br>> 3. What are your thoughts on KeyboardEvent >> #keyCode?
<br>> 4. Do you understand KeyboardEvent >> #physicalKey #virtualKey #physicalModifiers #virtualModifiers ?
<br>> 
<br>> Happy testing!
<br>> 
<br>> Best,
<br>> Marcel
<br>> 
<br>> P.S.: Don't forget about the X11 key (scan?) codes. ^__^ I haven't had the time to look into the VM plugin yet.
<br>> Am 27.04.2021 16:40:56 schrieb Marcel Taeumel <marcel.taeumel@hpi.de>:
<br>> Hi all!
<br>> 
<br>> 
<br>> Please find attached a changeset that adds mapping tables for virtual keys (or scan codes) for macOS, X11, and Windows. You can find them in EventSensor class >> #virtualKeysOn*
<br>> 
<br>> You can try out if they work through the KeyboardExerciser. Please take a look at the balloon text (i.e. tool tip) to better understand the data.
<br>> 
<br>> There is also a new preference:
<br>> [x] Simplify Virtual-key codes
<br>> 
<br>> ... because of Windows who dares to couple codes to the input language (e.g. US vs. DE), which Squeak knows nothing about. macOS is better in this regard. :-)
<br>> 
<br>> Biggest mess is on Linux/X11. For key-down/up events, the Linux VM delivers actual character codes instead of scan codes, which makes a basic mapping to physical keys almost impossible. See EventSensor class >> #virtualKeysOnX11. We MUST fix that! Please. Somebody. Can I haz scan codes? ^__^
<br>> 
<br>> ***
<br>> 
<br>> 
<br>> ***
<br>> 
<br>> The good news: KeyboardEvent >> #key (and UserInputEvent >> #modifiers) now gives you cross-platform stable information about physical keys to be used in keyboard handlers. Yes, for both key-stroke and key-down/up events.
<br>> 
<br>> Or at least, that is the plan. That's why it would be great if you could help testing! :-)
<br>> 
<br>> Why key-stroke events too? Aren't they for typing text only?
<br>> 
<br>> 1. Almost all keyboard shortcuts in current Squeak are based on key-stroke events.
<br>> 2. Using the #keyCharacter is tricky because SHIFT changes lower-case to upper-case, which makes "anEvent shiftPressed" hard to understand.
<br>> 3. CTRL combinations might not do the expected thing. How would you handle CTRL+C? The #keyCharacter could arrive as $c or Character enter. See the preference "Map non-printable characters to printable characters. Now, #key will always answer $C in such a case. Regardless of that preference.
<br>> 
<br>> Can't we just use #keyCharacter in key-down/up events?
<br>> 
<br>> No. Those are undefined. Never do that. key-down/up events carry virtual-key codes in their #keyValue. We might want to change #keyCharacter to answer "nil" for those events.
<br>> 
<br>> ***
<br>> 
<br>> Q: What is a "physical key" or "physical modifier"?
<br>> A: The label that can be presented to the user so that he or she feels at home when using Squeak. Thus, looks platform-specific.
<br>> 
<br>> Q: What is a "virtual key" or "virtual modifier"?
<br>> A: The information to be processed in your application's key handlers. Thus, looks platform-independent. If you have still no clue how to talk to keyboard events, please read the commentary in KeyboardEvent >> #checkCommandKey.
<br>> 
<br>> ***
<br>> 
<br>> Happy testing! :-) And thank you all in advance!
<br>> 
<br>> Best,
<br>> Marcel
<br>> 
<br>> P.S.: You might want to disable the preference "synthesize mouse-wheel events from keyboard-events" to get CTRL+ArrowUp and CTRL+ArrowDown ;-)
<br>
<br>
<br>
<br>
<br>> 
<br>
<br><br></marcel.taeumel@hpi.de></div></blockquote></div>