hpi-swa / trufflesqueak

A Squeak/Smalltalk VM and Polyglot Programming Environment for the GraalVM.
MIT License
283 stars 14 forks source link

Incorrect keyboard handling on Windows #160

Open LinqLover opened 2 years ago

LinqLover commented 2 years ago

So far, I stumbled upon the following keyboard gestures that are currently not supported in Windows:

fniephaus commented 2 years ago

Are you sure Alt is not accidentally mapped to something else, like the Win key?

LinqLover commented 2 years ago

Pressing Alt + P has the same effect as pressing just P. Every key that is pressed together with Ctrl + Alt or AltGr is completely ignored. Windows shortcuts work as usual.

By the way, there are further weird things going on. This is how the keyboard exerciser looks like after typing aA1:

image image

Typing p even raises an error because the keyCode 112 is not registered in the virtualKeyTable. It's interesting that simple typing in text editors still works at all. :-)

keyDowns look no better:

image

fniephaus commented 2 years ago

The root cause for all of this is that the OpenSmalltalkVM provides different events on different platforms and because of this, Squeak has covered this up on the image side. TruffleSqueak is very consistent because it's using Java AWT/Swing but that breaks on the image level. I guess you can tell that I don't use Windows much myself. Any contributions that makes this better are more than welcome. The KeyboardListener is actually quite simple: https://github.com/hpi-swa/trufflesqueak/blob/a068eca13ca09ac1de50bc4572dd53333fab8718/src/de.hpi.swa.trufflesqueak/src/de/hpi/swa/trufflesqueak/io/SqueakKeyboard.java#L15-L73

LinqLover commented 2 years ago

Thanks for the pointers. So I'm no longer confused that most of these shortcuts do not work in WSL/VcXsrv either. If the problem might be on the image side, I'll also talk with @marceltaeumel about it. :-)

fniephaus commented 2 years ago

We once thought about letting TruffleSqueak always prepend to run on Linux because of this. But then you of course run into many other problems (e.g., when trying to access the file system with the wrong delimiters).

LinqLover commented 2 years ago

Hm ... maybe we should introduce a new "omniplatform" type on the image side? SqueakJS might benefit from that as well.

fniephaus commented 2 years ago

Yes, that'd be nice!

fniephaus commented 10 months ago

FWIW, I just pushed https://github.com/hpi-swa/trufflesqueak/commit/8b03140335672a5318b00caa6796d3775ba82ff6 which also seems to fix some of the other items on your list.

LinqLover commented 10 months ago

Great!


From: Fabio Niephaus @.> Sent: Monday, December 18, 2023 12:09:10 AM To: hpi-swa/trufflesqueak @.> Cc: Christoph Thiede @.>; Author @.> Subject: Re: [hpi-swa/trufflesqueak] Incorrect keyboard handling on Windows (Issue #160)

FWIW, I just pushed 8b03140https://github.com/hpi-swa/trufflesqueak/commit/8b03140335672a5318b00caa6796d3775ba82ff6 which also seems to fix some of the other items on your list.

— Reply to this email directly, view it on GitHubhttps://github.com/hpi-swa/trufflesqueak/issues/160#issuecomment-1859316726, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AJH4PSUAHVLZ4KXL35ONIKDYJ53RNAVCNFSM5W5R4U72U5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCOBVHEZTCNRXGI3A. You are receiving this because you authored the thread.Message ID: @.***>