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) key-mapping.5.cs (21K) Download Attachment |
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
key-mapping.10.cs (34K) Download Attachment |
Hi Marcel, I tried it on macos and windows, no problem so far. I had some fun with the exercizer, some combinations are surprising indeed... Le ven. 23 avr. 2021 à 18:23, Marcel Taeumel <[hidden email]> a écrit :
|
Hi Marcel,
great idea, thanks for your work. It works fine on Windows as well as WSL/Ubuntu/VvXsrv for all my usual workflows. :-)
I noted some "breaking change", but actually it is a fix: When pressing something like Ctrl + ArrowLeft, the keystroke event no longer answers true for #commandKeyPressed but for #optionKeyPressed instead. This makes a workaround in WindowAcrobatics [1] superfluous.
The KeyboardExerciser is also a great tool. It gives a good overview of what is still left to do for the input mapping - that is (on Windows):
Best,
Christoph
Von: Squeak-dev <[hidden email]> im Auftrag von Nicolas Cellier <[hidden email]>
Gesendet: Samstag, 24. April 2021 20:58 Uhr An: The general-purpose Squeak developers list Betreff: Re: [squeak-dev] Please try it out | Fixing the input mapping for keystroke events Hi Marcel,
I tried it on macos and windows, no problem so far.
I had some fun with the exercizer, some combinations are surprising indeed...
Le ven. 23 avr. 2021 à 18:23, Marcel Taeumel <[hidden email]> a écrit :
Carpe Squeak!
|
Hi Christoph. > When pressing something like Ctrl + ArrowLeft, the keystroke event no longer answers true for #commandKeyPressed but for #optionKeyPressed instead. Could you be more specific? With the current default settings on Linux and Windows (see EventSensor class >> #startUp), you should get both #controlKeyPressed and #commandKeyPressed for [CTRL]+[ArrowLeft]. When you press [ALT]+[ArrowLeft], wenn you get true for #commandKeyPressed and #optionKeyPressed. Could you understand my explanations in KeyboardEvent >> #checkCommandKey regarding cross-platform compatibility? If not, what is missing? Best, Marcel
|
Free forum by Nabble | Edit this page |