[squeak-dev] Please try it out | Fixing the input mapping for keystroke events

Marcel Taeumel marcel.taeumel at hpi.de
Fri Apr 23 16:23:22 UTC 2021


Hi all!

Please find attached an updated changeset with a "KeyboardExerciser" to help you test and inspect the incoming keyboard events. You can find it also in the parts bin nearby the "ClickExerciser".


The visuals are supposed to look platform-specific. However, the event data contains information to make your application work across platforms. See KeyboardEvent >> #checkCommandKey for more explanations.

Try [CTRL]+[C] for keyStroke, keyDown, and keyUp.

Note that the visuals might not look right for keyUp and keyDown events due to missing lookup tables for the raw, platform-specific key codes. On my machine, for example, [,] and [.] and [-] look odd:



Nothing to worry about because all keyboard shortcuts in Squeak use keyStroke events at the moment.

Best,
Marcel
Am 22.04.2021 10:41:15 schrieb Marcel Taeumel <marcel.taeumel at hpi.de>:
Hi all!

Please find attached a changeset that improves the cross-platform base for keystroke events. Please try it out and take a look at it. Report issues ASAP so that I can merge it into Trunk soon.

Thanks to Tom (tobe), the new promising idea is to replace the existing attempt:

Duplicate all control and alt keys
Duplicate control and alt keys
Swap control and alt keys

With the following preferences:

[X] Map ASCII control characters to printable characters

 - Default is TRUE
 - Only affects events that have the CONTROL modifier set (e.g. CTRL+J)
 - Rather application-specific than platform-specific
[X] Map CONTROL keys to COMMAND keys

 - Checked at image start-up
 - TRUE on Windows/Linux
 - FALSE on macOS
[X] Map ALT keys to OPTION keys
 - Checked at image start-up
 - TRUE on Windows/Linux
 - FALSE on macOS (bc. ALT==CMD on recent Linux/Windows VMs)

Please take a look at KeyboardEvent >> #checkCommandKey to learn about the fundamental trade-off we have solved.

Please try out your preferred applications. Feel free to add logging to HandMorph >> #logEvent: for more convenient testing:

(anEvent isKeyboard and: [anEvent isKeystroke])
   ifTrue: [Transcript showln: anEvent].

Thanks!

Best,
Marcel (and Tom)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20210423/78840525/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 37054 bytes
Desc: not available
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20210423/78840525/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 9239 bytes
Desc: not available
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20210423/78840525/attachment-0003.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: key-mapping.10.cs
Type: application/octet-stream
Size: 31892 bytes
Desc: not available
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20210423/78840525/attachment-0001.obj>


More information about the Squeak-dev mailing list