keyboard events in the windows VM

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

keyboard events in the windows VM

Nicolai Hess-3-2
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":
keycode:
65 (keydown event)
97 (keyvalue/charcode event) (65 if you press shift key)
65 (keyup event)

with ctrl key pressed:
keycode
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)
but
#(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?



nicolai



Reply | Threaded
Open this post in threaded view
|

Re: [Pharo-dev] keyboard events in the windows VM

Nicolai Hess-3-2
Anyone from Squeak/SqueeakVM interested on this change?

I can build a squeak vm as well and / or provide a vm-source patch file.


2015-11-13 8:33 GMT+01:00 Nicolai Hess <[hidden email]>:


2015-11-12 16:43 GMT+01:00 EuanM <[hidden email]>:
I'm happy to test on Windows 7, and on Raspbian Linux

(Although Raspbian Linux runs Pharo UI events slo-o-owly, so I am not
the best person to do the Linux testing)

Thank you EuanM,
I 'll provide a vm with these changes. All changes are only for the windows vm at the moment.
 

On 12 November 2015 at 15:42, EuanM <[hidden email]> wrote:
> I think anything that makes a consistent UI to Pharo for users on
> different platforms is a good thing.
>
> However, I do not know what the downside-effects of this change are.
>
> The key thing is to capture all breaks caused by the changed, so they
> can be coded through or around.  And ensure that the test results are
> viewed with at least the same importance as the automated Jenkins CI
> test results.
>
> I do not know the extent that the Jenkins CI tests actually simulate
> user keyboard input, so...   (Pharo pseudocode for comic effect and
> clarity)
>
> We can write Jenkins tests that simulate user input
>    ifTrue: [ we should do so ].
>    ifFalse: [
>      we should
>        write a canonical set of regression test scripts for human
> users to follow .
>      we should
>        do: [:eachPlatformSupportedByPharo |
>              run the tests in which humans use keyboard tasks ]  .
>      we should
>        capture the results ;
>        and feed them into automated the regression tests results database
>     ]
>
>
> On 12 November 2015 at 08:35, Nicolai Hess <[hidden email]> wrote:
>> 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":
>> keycode:
>> 65 (keydown event)
>> 97 (keyvalue/charcode event) (65 if you press shift key)
>> 65 (keyup event)
>>
>> with ctrl key pressed:
>> keycode
>> 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)
>> but
>> #(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?
>>
>>
>>
>> nicolai
>>





Reply | Threaded
Open this post in threaded view
|

Re: [Pharo-dev] keyboard events in the windows VM

marcel.taeumel
Very much interested. :) If there are changes that generate different events in Smalltalk land, we should provide Smalltalk code to simulate previous behavior if needed. But for most (if not all) of your changes, this should not be necessary.

Best,
Marcel
Reply | Threaded
Open this post in threaded view
|

Re: [Pharo-dev] keyboard events in the windows VM

Nicolai Hess-3-2


2015-11-16 10:59 GMT+01:00 marcel.taeumel <[hidden email]>:
Very much interested. :) If there are changes that generate different events
in Smalltalk land, we should provide Smalltalk code to simulate previous
behavior if needed. But for most (if not all) of your changes, this should
not be necessary.

this is the change I did for the pharo-vm
(here the diff against squeaks-vm sqWin32Windows.c)
The in-image keyevent handling is slighty different for pharo and squeak.
It looks like squeak already interpret some keydown events as keystroke events
just because the vm did not generate the keychar events.
(for example, ctrl+1,ctrl+2, ..., don't create keystroke events, only keydown and up events,
and the dockingbar morph uses these events (instead of "real" keystrokes, to activate the submenus)

 

Best,
Marcel



--
View this message in context: http://forum.world.st/keyboard-events-in-the-windows-VM-tp4860620p4861183.html
Sent from the Squeak - Dev mailing list archive at Nabble.com.





squeak_win_vm_ctrl_key.patch (3K) Download Attachment