Mantis - Squeak
Viewing Issue Advanced Details
7611 VM minor always 03-07-11 00:06 03-07-11 00:06
0007611: Windows VM not handling <ctl><m> properly
Windows VM does not report <ctl><m> key events properly. Problem reported with suggested fix on vm-dev at [^]

Additional background is at [^]
Issue is reported as a "cog bug" but presumably affects standard VM also, as they share identical support code. The suggested fix (see links above) is:


'ctrl + m' problem is Cog VM bug.

Normally, when character key is pushed, keyboard events occur as follows on

1. key press (down)
2. character (character code notification)
3. key release (up)

They are produced by a primitive method in IutEventFetcher >>
But when ctrl + m is pushed, a character event doesn't occur.
Because 'ctrl + m' value is 13. The value is same as ENTER key.
Cog VM ignores WM_CHAR message(character event) when ENTER key is pushed.

The one of solution for this problem is to add CTRL key state to the

-- sqWin32Window.c --

int recordKeyboardEvent(MSG *msg) {

 switch(msg->message) {

   case WM_CHAR:
   case WM_SYSCHAR:
     /* Note: VK_RETURN is recorded as virtual key ONLY */
     if(keyCode == 13 && !ctrl) return 1; // add "&& !ctrl"
     pressCode = EventKeyChar;

Note: ENTER keyCode is 13. But when ctrl + ENTER is pushed, the keyCode is
So if the condition is revised, ctrl + m problem is corrected.
but other behavior is not changed.

If you want to prevent to generate character event for CTRL + ENTER,
you can add following code. By this way, we can produce
not only ctrl+m (0x0D)'s character event but also ctrl+j (0x0A)'s one.

There are no notes attached to this issue.