Tim Johnson reported a problem with 32b Linux builds: Pressing ctrl-d now acts like debugIt instead of doIt like in the 64b. Ctrl-p also stopping working. I did a bisection of all versions in https://bintray.com/opensmalltalk/vm/cog/ and narrowed down the problem to good squeak.cog.spur_linux32x86_201811272342.tar.gz The error is consistent on both 18231 and the oldest 18221 released image for 32b VM but does not appear with 64b VMs. — |
Thanks for all the work you've done on this. — |
In reply to this post by David T Lewis
Thanks Tim, The following lines in sqUnixX11.c doesn't seem right. When Ctrl and p are pressed at the same time, sq2KeyPlain should return ctrl-p (16r10). This code returns p instead (16r70). I don't understand why this change was made.2065 if (charCode >= 1 && charCode <= 26) {
|
In reply to this post by David T Lewis
Relevant commit: 1b837f9 — |
In reply to this post by David T Lewis
Tim, I used gdb to nop out above code in the text segment as this was quicker and easier than trying to rebuild a 32b binary. Then the image worked like charm. The comment in recode() is confusing and I need time to understand its rationale. Shift is keyboard specific and decides charCode and should be handled in the VM while Ctrl is a modifier and should be passed to the image. So I don't understand why a key event should be generated when Shift alone is pressed or released. I also found a thread from 2012 where Guillermo Polito fixed a similar problem in Windows code HTH .. Subbu — |
In reply to this post by David T Lewis
Hi Subbu, — |
In reply to this post by David T Lewis
So, if I understand the issue, the problem is that we always get — |
In reply to this post by David T Lewis
The https://linux.die.net/man/3/xlookupstring sounds clear to me: it should honour the shift for the
Does it work like advertised? We'd better activate — |
In reply to this post by David T Lewis
Actually, the problem is that charCode in sq2KeyPlain has already translated ctrl and XK_a as ctrl-a (16r1), but the errant code returns 'a' instead of ctrl-a. — |
In reply to this post by David T Lewis
Hi Subbu, you made very good job at tracking the changes causing the problem, but I'm not sure that reverting is the right solution, this change was made for some reason. If we want to disentangle the code and remove some cruft we need better understanding. So let's focus on symptoms: CTRL+d is performing So clearly, the CTRL/CMD or whatever modifier is taken into account, and transformation of keyValue to Ctrl-d code (0x4) is not necessary. It is not only not necessary, it also create various problems of interpretation of keyboard event, because 0x4 is also the encoding of END key, see implementors/senders of The problem we observe in Squeak images is that the A good candidate for suspiscion is in
Ahah: I don't know if this is a MacOS-centric piece of code or what, but if we generate CTRL modifier instead of CMD modifier, maybe the image code ain't gonna perform the cmdActions, but rather the shiftCmdActions as we observe. Since you seem to identify a change in modifier state between old and new VM, this is maybe where we start inquiring instead. The keyboard event is composed of several parts:
But only one code is retained in the Note that Ctrl-d has some mapping in shiftCmdActions, "thanks" to this super hack in
which implies that shift-command But I do not see any thing like that in cmdActions, You see that this would/could conflict with END key special actions (same for other special keys encoding), which is a bad thing. The Ctlr-d (0x4) value & co are a bad thing coming from the past (like console mode compatibility) that we do not need, neither at low level keyboard handling (KeyUp KeyDown), nor at higher level synthetic event handling (KeyStroke/KeyChar). I think we'd better keep the change you legitimately incriminated, and I would rather try to understand all the implications of — |
In reply to this post by David T Lewis
Hi Nicolas, I need to ask, though: why then is this only a problem on 32-bit Linux VMs but not 64-bit Linux VMs? Thanks, — |
In reply to this post by David T Lewis
Paraphrasing feenkcom/gtoolkit#9 found by @akgrant43 ...
— |
In reply to this post by David T Lewis
Paraphasing http://forum.world.st/Linux-Squeak-VM-X11-keyboard-changes-td5099584.html
— |
In reply to this post by David T Lewis
Paraphasing http://forum.world.st/Windows-cog-vm-Keyboard-events-related-about-keycode-mapping-td4330359.html
And other keys are the same, image-side having the same keycode with different keys. case WM_CHAR:
case WM_SYSCHAR:
/* Note: VK_RETURN is recorded as virtual key ONLY */
if(keyCode == 13) return 1;
+ charCode = keyCode;
pressCode = EventKeyChar;
break
...
- evt->charCode = keymap[keyCode & 0xff];
+ evt->charCode = charCode? charCode : keymap[keyCode & 0xff];
What was the conclusion of looking at that @guillep? — |
In reply to this post by David T Lewis
Side comment 1 from http://forum.world.st/Windows-cog-vm-Keyboard-events-related-about-keycode-mapping-td4330359.html
— |
In reply to this post by David T Lewis
Side comment 2 from http://forum.world.st/Windows-cog-vm-Keyboard-events-related-about-keycode-mapping-td4330359.html
— |
In reply to this post by David T Lewis
Thank you, Nicolas, for your detailed analysis of the code path for handling keystrokes in the editor. Initially, I too traced this path and noticed that EventSensor>>processEvent: maps keystrokes using KeyDecodeTable before calling processKeyboardEvent. Key alt-d correctly invoked cmdActions in both 32b and 64b images but ctrl-d invoked shiftCmdActions in 32b image instead of cmdActions. The KeyDecodeTable is different in these two images. I agree that the sqUnixX11.c file is very messy and confusing. It mixes X11 terms (raw keycode and mapped keysym) with Squeak specific terms (keycode, charcode). JB's patch broke 32b image but not 64b. I proposed a partial rollback of this patch to get TimJ going while we sort out the mess. — |
In reply to this post by David T Lewis
The change was made for this reason:
When running with the old vm and pressing/releasing Ctrl-a, I get this printed to the transcript:
When running with the new vm I get:
The new vm generates the correct codes, but Ctrl-a isn't selecting the whole text. Watching the events using — |
In reply to this post by David T Lewis
Are you sure that it is working in a 64-bit image? I wasn't able to use Ctrl-a in my 64-bit vm using a Squeak 5.2 image with the new vm. — |
In reply to this post by David T Lewis
I haven't tested it. I am just taking others' word that they tested a 64-bit VM and could not reproduce the problem I was reporting on my 32-bit VM. — |
Free forum by Nabble | Edit this page |