<div id="__MailbirdStyleContent" style="font-size: 10pt;font-family: Arial;color: #000000;text-align: left" dir="ltr">
                                        ...maybe one more thought. The information behind USB HID devices does not reveal information about localization, maybe also because the same buttons may be used for different layouts. Take DE vs. UK as an example. Just the ink on the buttons is different:<div><br></div><div><span style="font-size: 13.3333px">https://en.wikipedia.org/wiki/QWERTZ</span><br></div><div><span style="font-size: 13.3333px">https://en.wikipedia.org/wiki/File:German-Keyboard-Layout-T2-Version1-large.png</span><br></div><div><br></div><div><span style="font-size: 13.3333px">https://en.wikipedia.org/wiki/QWERTY</span><br></div><div><span style="font-size: 13.3333px">https://en.wikipedia.org/wiki/File:KB_United_Kingdom.svg</span><br></div><div><br></div><div>(https://stackoverflow.com/questions/39388141/send-language-layout-from-usb-hid-keyboard)</div><div><br></div><div>Best,</div><div>Marcel<br><div><br></div><div><br></div><div class="mb_sig"></div>
                                        </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 03.05.2021 10:59:16 schrieb Marcel Taeumel <marcel.taeumel@hpi.de>:</p><div style="font-family:Arial,Helvetica,sans-serif"><div id="__MailbirdStyleContent" style="font-size: 10pt;font-family: Arial;color: #000000;text-align: left" dir="ltr">
                                        <div><span style="font-size: 13.3333px">Hi Christoph,</span></div><div><span style="font-size: 13.3333px"><br></span></div><div><span style="font-size: 13.3333px">thanks for your thoughts. There might be a need for some clarification, especially the difference between "key character" and "(virtual) key".</span></div><div><span style="font-size: 13.3333px"><br></span></div><div><span style="font-size: 13.3333px">First of all, the visuals of the KeyboardExerciser do not match writing tools but physical keyboards. While you can explore the input event and take a look at #keyCharacter, I suggest you use a workspace to try whether you can still type and write characters as you need.</span></div><div><span style="font-size: 13.3333px"><br></span></div><div><span style="font-size: 13.3333px">Second, dead keys such as the circumflex mainly affect #keyCharacter because they should help you type characters in your writing tool. Regarding physical keys and their presses, dead keys are rather inconvenient. You would have to press them twice to register a single key-down event.</span></div><div><span style="font-size: 13.3333px"><br></span></div><div><span style="font-size: 13.3333px">Now back to the virtual keys and key codes.</span></div><div><span style="font-size: 13.3333px"><br></span></div><div><span style="font-size: 13.3333px">You raised the question about different keyboard layouts. At best, the operating system would abstract virtual-key codes (i.e. keyboard layout) from input language (e.g. US, DE). So, on QWERTZ with DE, you will get key-code for Q, W, E, R, T, Z and on QWERTY with US you get ... Y. </span></div><div><span style="font-size: 13.3333px"><br></span></div><div><span style="font-size: 13.3333px">If you lie about your physical layout for more convenient typing, it becomes tricky. The user is not aware of the labels on the physical keys but relies on the virtual abstraction. So, pressing the key labeled "Z" while thinking about Y and then getting the key-code for Z might be surprising. That's why Windows relies on the user to tell which kind of keyboard she has attached. After wall, the operating system does not use a camera to check the physical world itself. Hehe.</span></div><div><span style="font-size: 13.3333px"><br></span></div><div><span style="font-size: 13.3333px">At the end of the day, we have to rely on the user telling the truth to the operating system about the layout of the physical keyboard. Luckily, modern operating systems separate keyboard layout from input language for spelling correction etc. For example, I have QWERTZ also configured for English, not just German.</span></div><div><span style="font-size: 13.3333px"><br></span></div><div><span style="font-size: 13.3333px">That's why DVORAK can work. You just have to tell your operating system that your keyboard has the DVORAK layout. It's nothing Squeak has to take care of.</span></div><div><span style="font-size: 13.3333px"><br></span></div><div><span style="font-size: 13.3333px">Best,</span></div><div><span style="font-size: 13.3333px">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 01.05.2021 19:51:04 schrieb Thiede, Christoph <christoph.thiede@student.hpi.uni-potsdam.de>:</p><div style="font-family:Arial,Helvetica,sans-serif">
<div id="divtagdefaultwrapper" style="font-size: 12pt;color: #000000;font-family: Calibri,Helvetica,sans-serif" dir="ltr">
<div id="divtagdefaultwrapper" style="font-size: 12pt;color: rgb(0, 0, 0);font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols" dir="ltr">
<p>Hi Marcel,</p>
<p><br>
</p>
<p>following observations for your first question:</p>
<p><br>
</p>
<p></p>
<ul style="margin-bottom: 0px; margin-top: 0px;">
<li>Key strokes for characters such as $+, $#, $ß, $?, or $- yield "Squeak1" or "Squeak2" in my image.</li><li>Combinations such as "dead circumflex , space" that print a $^ on my Qwertz system are displayed as pure "space" in the tool.</li><li>Ctrl + Alt + E (types $€), Ctrl + Alt + 7 (types ${), Alt + (NumPlus , Num2, Num0) (types $ ), etc. are printed as "E", "7", "0", etc. only.</li></ul>
<div><br>
</div>
<div>Regarding your remaining questions, I cannot really add much value to this because I have never dealt with this before. But there weren't any WTF moments. :-)</div>
<p></p>
<div id="Signature">
<div id="divtagdefaultwrapper" dir="ltr" style="font-size: 12pt;color: rgb(0, 0, 0);font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols">
<div name="divtagdefaultwrapper" style="font-family: Calibri,Arial,Helvetica,sans-serif;font-size: ;margin: 0">
<div><span style="font-size: 10pt;color: #808080"></span></div>
</div>
</div>
</div>
What about different keyboard layouts such as QWERTZ/QWERTY/AWERTY etc.? What about virtual ways to enter characters (e.g. tools for special characters, emojipads, etc.). How do you make sure that these virtual keys are mapped correctly to their physical equivalents?</div>
<div id="divtagdefaultwrapper" style="font-size: 12pt;color: rgb(0, 0, 0);font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols" dir="ltr">
<br>
</div>
<div id="divtagdefaultwrapper" style="font-size: 12pt;color: rgb(0, 0, 0);font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols" dir="ltr">
Best,</div>
<div id="divtagdefaultwrapper" style="font-size: 12pt;color: rgb(0, 0, 0);font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols" dir="ltr">
Christoph<br>
<br>
<div style="color: rgb(0, 0, 0);">
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><span style="font-family: Calibri, sans-serif;color: #000000"><b>Von:</b> Squeak-dev <squeak-dev-bounces@lists.squeakfoundation.org> im Auftrag von Taeumel, Marcel<br>
<b>Gesendet:</b> Mittwoch, 28. April 2021 12:02 Uhr<br>
<b>An:</b> squeak-dev<br>
<b>Betreff:</b> Re: [squeak-dev] Please try out | Cross-platform mapping for virtual key codes :-)</span>
<div> </div>
</div>
<div>
<div id="__MailbirdStyleContent" dir="ltr" style="font-size: 10pt;font-family: Arial;color: #000000;text-align: left">
<div><span style="font-size: 13.3333px">Hi all!</span></div>
<div><span style="font-size: 13.3333px"><br>
</span></div>
<div><span style="font-size: 13.3333px">Here is a small update. Please find attached the changeset.</span></div>
<div><span style="font-size: 13.3333px"><br>
</span></div>
<div><span style="font-size: 13.3333px">Updates:</span></div>
<div><span style="font-size: 13.3333px">- Adds KeyboardEvent >> #keyCode (via new inst-var)</span></div>
<div><span style="font-size: 13.3333px">- Logs the last key-down event to attach virtual-key codes to key-stroke events; see HandMorph >> #generateKeyboardEvent:</span></div>
<div><span style="font-size: 13.3333px">- Simplifies KeyboardEvent >> #key</span></div>
<div><span style="font-size: 13.3333px">- Show event repetition in KeyboardExecizer</span></div>
<div><span style="font-size: 13.3333px"><br>
</span></div>
<div><img naturalheight="198" naturalwidth="847" id="f6d464cc-dd08-4ed5-aba3-046dd659a427" width="519" height="121" style="user-select: none;" src="cid:64f61a46-f546-4de3-8792-45bd873a11f5"></img><span style="font-size: 13.3333px"><br>
</span></div>
<div><span style="font-size: 13.3333px"><br>
</span></div>
<div><span style="font-size: 13.3333px">Major questions:</span></div>
<div><span style="font-size: 13.3333px">1. Does it work on your machine?</span></div>
<div><span style="font-size: 13.3333px">2. What are your thoughts on KeyboardEvent >> #key?</span></div>
<div><span style="font-size: 13.3333px">3. What are your thoughts on KeyboardEvent >> #keyCode?</span></div>
<div><span style="font-size: 13.3333px">4. Do you understand KeyboardEvent >> #physicalKey #virtualKey #physicalModifiers #virtualModifiers ?</span></div>
<div><span style="font-size: 13.3333px"><br>
</span></div>
<div><span style="font-size: 13.3333px">Happy testing!</span></div>
<div><span style="font-size: 13.3333px"><br>
</span></div>
<div><span style="font-size: 13.3333px">Best,</span></div>
<div><span style="font-size: 13.3333px">Marcel</span></div>
<div><span style="font-size: 13.3333px"><br>
</span></div>
<div><span style="font-size: 13.3333px">P.S.: Don't forget about the X11 key (scan?) codes. ^__^ I haven't had the time to look into the VM plugin yet.</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 27.04.2021 16:40:56 schrieb Marcel Taeumel <marcel.taeumel@hpi.de>:</p>
<div style="font-family:Arial,Helvetica,sans-serif">
<div id="__MailbirdStyleContent" dir="ltr" style="font-size: 10pt;font-family: Arial;color: #000000;text-align: left">
<div>Hi all!<br>
</div>
<div><span style="font-size: 13.3333px"><br>
</span></div>
<div><span style="font-size: 13.3333px">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*</span></div>
<div><span style="font-size: 13.3333px"><br>
</span></div>
<div><span style="font-size: 13.3333px">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.</span></div>
<div><span style="font-size: 13.3333px"><br>
</span></div>
<div><span style="font-size: 13.3333px">There is also a new preference:</span></div>
<div><span style="font-size: 13.3333px">[x] Simplify Virtual-key codes</span></div>
<div><span style="font-size: 13.3333px"><br>
</span></div>
<div><span style="font-size: 13.3333px">... 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. :-)</span></div>
<div><span style="font-size: 13.3333px"><br>
</span></div>
<div><span style="font-size: 13.3333px">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? ^__^</span></div>
<div><span style="font-size: 13.3333px"><br>
</span></div>
<div><span style="font-size: 13.3333px">***</span></div>
<div><img naturalheight="408" naturalwidth="931" id="af6cb333-4a04-4609-ac24-d8d07d02b787" width="491" height="215" style="user-select: none;" src="cid:4d3dcc25-f68b-4238-a5a7-bf997a213c69"></img><span style="font-size: 13.3333px"><br>
</span></div>
<div><span style="font-size: 13.3333px"><br>
</span></div>
<div><span style="font-size: 13.3333px">***</span></div>
<div><span style="font-size: 13.3333px"><br>
</span></div>
<div><span style="font-size: 13.3333px">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.</span></div>
<div><span style="font-size: 13.3333px"><br>
</span></div>
<div><span style="font-size: 13.3333px">Or at least, that is the plan. That's why it would be great if you could help testing! :-)</span></div>
<div><span style="font-size: 13.3333px"><br>
</span></div>
<div><span style="font-size: 13.3333px">Why key-stroke events too? Aren't they for typing text only?</span></div>
<div><span style="font-size: 13.3333px"><br>
</span></div>
<div><span style="font-size: 13.3333px">1. Almost all keyboard shortcuts in current Squeak are based on key-stroke events.</span></div>
<div><span style="font-size: 13.3333px">2. Using the #keyCharacter is tricky because SHIFT changes lower-case to upper-case, which makes "anEvent shiftPressed" hard to understand.</span></div>
<div><span style="font-size: 13.3333px">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.</span></div>
<div><span style="font-size: 13.3333px"><br>
</span></div>
<div><span style="font-size: 13.3333px">Can't we just use #keyCharacter in key-down/up events?</span></div>
<div><span style="font-size: 13.3333px"><br>
</span></div>
<div><span style="font-size: 13.3333px">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.</span></div>
<div><span style="font-size: 13.3333px"><br>
</span></div>
<div><span style="font-size: 13.3333px">***</span></div>
<div><span style="font-size: 13.3333px"><br>
</span></div>
<div><span style="font-size: 13.3333px">Q: What is a "physical key" or "physical modifier"?</span></div>
<div><span style="font-size: 13.3333px">A: The label that can be presented to the user so that he or she feels at home when using Squeak. Thus, looks platform-<b>specific</b>.</span></div>
<div><span style="font-size: 13.3333px"><br>
</span></div>
<div><span style="font-size: 13.3333px">Q: What is a "virtual key" or "virtual modifier"?</span></div>
<div><span style="font-size: 13.3333px">A: The information to be processed in your application's key handlers. Thus, looks platform-<b>independent</b>. If you have still no clue how to talk to keyboard events, please read the commentary in KeyboardEvent >> #checkCommandKey.</span></div>
<div><span style="font-size: 13.3333px"><br>
</span></div>
<div><span style="font-size: 13.3333px">***</span></div>
<div><span style="font-size: 13.3333px"><br>
</span></div>
<div><span style="font-size: 13.3333px">Happy testing! :-) And thank you all in advance!</span></div>
<div><span style="font-size: 13.3333px"><br>
</span></div>
<div><span style="font-size: 13.3333px">Best,</span></div>
<div><span style="font-size: 13.3333px">Marcel</span></div>
<div><span style="font-size: 13.3333px"><br>
</span></div>
<div><span style="font-size: 13.3333px">P.S.: You might want to disable the preference "synthesize mouse-wheel events from keyboard-events" to get CTRL+ArrowUp and CTRL+ArrowDown ;-)</span></div>
<div class="mb_sig"></div>
</div>
</div>
</blockquote>
</div>
</div>
</div>
</div>
</div>
</div></blockquote>
                                        </div></div></blockquote></div>