[Vm-dev] keyboard events in the windows VM

Nicolai Hess nicolaihess at gmail.com
Thu Nov 12 08:35:16 UTC 2015

A short overview:

With Ctrl-Key pressed,

some keyboard events don't generate smalltalk keystrokes (EventKeyChar)
ctrl+tab, ctrl+1, ctrl+2, ..., ctrl+0, ctrl+Tab, ctrl+m

for some keyboard events there are only key down and key up events (from
windows) but the vm "generates" a keypress (EventKeyChar) event
ctrl+Home, ctrl+End, ctrl+PageUp, ...

But the key value , char code and ctrl flag for this generated events, make
them undistinguishable from other ctrl+key shortcuts
ctrl+a = ctrl+Home, ctrl+d = ctrl+End, ctrl+k=ctrl+PageUp,...

And one key (ctrl+Enter) creates two EventKeyChar events one "normal" and
one that is generated from the vm
one with keyvalue 10 and one with 13.

And the keycode for char like "a","b", ..., are different if you they are
typed with or without ctrl-key

just key "a":
65 (keydown event)
97 (keyvalue/charcode event) (65 if you press shift key)
65 (keyup event)

with ctrl key pressed:
65 (keydown event)
1 (keyvalue/charcode event)
65 (keyup event)

I would like to change this, that means:

generate EventKeyChar events for
ctrl+1, ctrl+2, ..., ctrl+Tab, ctrl+m

remove the double key event for ctrl+Enter

and adopt the behavior of the linux vm, for keyValue, charCode values for
events like
ctrl+a, ctrl+home, ...

for example, the linux vm generates event buffer values:
#(2 7329656 1 0 2 65 0 1) for  ctrl+a  (keyValue 1/charCode 65)
#(2 7329656 1 0 2 1 0 1) for  ctrl+home  (keyValue 1/charCode 1)

this may need some changes on the image side. For example, in Pharo we
have some special handling that adds "96" to the keyValue for keystrokes
with ctrl-key).

What do you think?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20151112/b58cd93f/attachment.htm

More information about the Vm-dev mailing list