[Vm-dev] [OpenSmalltalk/opensmalltalk-vm] Elided code that caused ctrl keyboard shortcuts to fail on 32b images (#400)

Ben Coman notifications at github.com
Wed Jun 12 14:30:19 UTC 2019

Good find @akgrant43. Paraphrasing feenkcom/gtoolkit#9...

> Girba: A piece of information about this bug. There is an inconsistency in Mac and Linux VMs when it comes to keyboard events:
OSX generates keyDown: events for keys like shift , ctrl or meta when I press the corresponding keys, while
Linux VM generates keyDown: events for ctrl when we release the key
Our issue is at a lower level then Morphic.
@syrel used logging statements in HandMorph>>#generateKeyboardEvent:. It appears that it is not called when we press a modifier key on Linux.

> syrel: Indeed, the keyboard events for shift are sent but the question is when they are sent. We state that they are not sent when we press the shift button, but instead when we release it. This is a very important and crucial difference that does not let us to have simple and clear shortcut handling in Bloc on linux. In Bloc by design we assume that whenever a key is pressed - we get a keydown event (hence it has down in it), right after that for printable characters we get keystroke (or input) event that gets resent every X seconds depending on OS settings and finally when user releases her finger we get keyup event. Unfortunately this does not happen for keys like shift, alt and ctrl while perfectly works for regular keys like A, M, Z.
@akgrant43 I have no idea why it works for you but doesn’t work for multiple other people. We are debugging this for the latest Pharo7 64bit with latest VM on Linux Mint 64bit.

> akgrant43: I'm not seeing this behaviour (Ubuntu 16.04).
Adding logging to:
Shows them being called at the expected times, i.e. as the ctrl key is being pressed and released.
Linux Mint, if I remember correctly, is typically based on a fairly old version of Ubuntu (not that mine is recent :-)). Maybe there's a change in the kernel or graphics stack?

> j-brant: I have gotten the keyboard shortcuts to work under my Linux Mint installation. There were a few issues. First, the KeyboardKey class was using the wrong key table for Unix. Second, the right Unix key table was missing the right control & alt keys. These were addressed in https://pharo.manuscript.com/f/cases/22769 and have been integrated into the latest Pharo build.
The other issues were VM issues. When you pressed and then released either the control or shift keys, the correct key would be recorded as pressed, but character code $? would be reported when the key was released. This causes the editor to believe the control key was still pressed even after it was released since it never got the key up for the control. The other VM issue was that A-Z keys being pressed when the control was pressed was being reported as character code 1-26 instead of the letters a-z. On the other platforms, they are reported as letters with the control key pressed. On Linux, they were reported with the control key down, but with character codes 1-26. To fix the VM issues, I added some code to the x2sqKeyPlain method in sqUnixX11.c file before the return (j-brant/opensmalltalk-vm at 37e3abf):

You are receiving this because you commented.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20190612/fa4990f8/attachment-0001.html>

More information about the Vm-dev mailing list