[Vm-dev] [OpenSmalltalk/opensmalltalk-vm] Linux Squeak VM X11 keyboard changes breaks 32b VM (#396)

Nicolas Cellier notifications at github.com
Wed Jun 12 21:20:35 UTC 2019

So why does CTRL+d work?

If you have `Preferences duplicateAllControlAndAltKeys = true`, then

    KeyDecodeTable at: { key bitAnd: 16r9F . 2 } put: { key . 8 }.

will replace Ctrl-d code (0x4) + CTRL modifier (2) by $d + CMD modifier (8).<br>
Indeed, 0x4 = `$d asInteger bitAnd: 16r9F`- since bitAnd: 16r9F is like subtracting 64 from uppercase letters, and subtracting 96 from lowercase letters. Note that such 16r9F may have all sort of unpalatable effects on internationalized characters + CTRL... It's not internationalization friendly.

If you have a VM outputting $d + CTRL, then this translation does NOT happen, and we encounter the strange code in `TextEditor>>dispatchOnKeyboardEvent:` that interprets CTRL modifier as SHIFT+CMD... That's complete madness at image side, so IMO we'd better not fix the VM (well we should continue cleaning, but not for this bug)!

> Why 32 and 64 bits image differ? 

They don't. Only the preferences may differ or not... So some squeakers will reproduce the problem some not, it's just random.

If other preferences is selected, like `Preferences duplicateControlAndAltKeys = true`, the problem will only ever happen with `self defaultCrossPlatformKeys`, that is CTRL+a c x v f g s z.

It may also depends on the `World currentHand keyboardInterpreter class`, because if VM delivers event at: 3 as Ctrl-d and event at: 6 as $d asInteger, then depending on which KeyDecodeTable translations happens, and which of the two codes is taken into account in the morphic KeybordEvent, that's quite many different possible behaviors, not all of which are inline with our expectations. 

We see that fixing the VM to make Brick/Bloc/GT/Whatever work, may break Morphic/MVC because they already have crooked workarounds that now fail. We arrived at a point where we cannot change a single feature without breaking another. Unpalatable!

It does not mean we do not have to change things. We want to be able to evolve. We want a VM doing what it says and saying what it does (specs and docs please!), if possible not too complex things: that is transform OS specific events into platform agnostic events (preferably union of possible events rather than intersection IMO, or we'll never be on tablets and phones). While increasing VM consistency, we can start to disentangling image code and remove some hacks.

But for this to happen, we have to put all expectations on the table and make some choice. CTRL = SHIFT+CMD is highly questionable for example, I'd like to know where it comes from to begin with? This is not the place to debate that, it's Squeak specific.

I would rather close the issue and fix Squeak. Thoughts?

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/7fa2573d/attachment-0001.html>

More information about the Vm-dev mailing list