Modifier key events

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

Modifier key events

Balázs Kósi
Hi,

I was fiddling with the docking bar's keyboard control, when bumped
into this problem:
Modifier keys are not handled uniformly on different vms [1].

This issue was disscussed not so long ago [2], but there were no conclusions.
It would be nice if event handling on different vms would converge.

Balázs

[1]
If I press and release the ctrl key on a 4.2.2beta1U mac vm, I get events like:
[436@515 436@515 mouseMove CTRL 3939704]
[436@515 436@515 mouseMove 3939788]

On a windows vm I get:
[keyDown '<Cmd->']
[keyUp '']

In the above thread it's said that no events are generated on Linux vms,
and this is the case with the 64-32 5.4b1 mac vm too.

[2] http://lists.squeakfoundation.org/pipermail/squeak-dev/2009-June/136491.html

Reply | Threaded
Open this post in threaded view
|

Re: Modifier key events

Balázs Kósi
Hi,

pressing ctrl+` on mac produces the following keyboard events:
[keyDown '<Ctrl-2>']
[keystroke '<Ctrl-`>']
[keyUp '2']

on windows we get:
[keyDown '<Cmd->']
[keyDown '<Ctrl-À>']
[keyUp '<Ctrl-À>']
[keyUp '']

So docking bar activation is not working under windows.
What do you think about binding the docking bar menus to ctrl-<n> by
position like:
ctrl-1 squeak menu
ctrl-2 Project menu
etc...

And what do you think in general about using ctrl- keystrokes for
image wide shortcuts?
Like ctrl-w always closing the topmost window, not just when the World
has the keyboard focus.

Balázs

Reply | Threaded
Open this post in threaded view
|

Re: Modifier key events

Bert Freudenberg
On 25.02.2010, at 13:43, Balázs Kósi wrote:

>
> Hi,
>
> pressing ctrl+` on mac produces the following keyboard events:
> [keyDown '<Ctrl-2>']
> [keystroke '<Ctrl-`>']
> [keyUp '2']
>
> on windows we get:
> [keyDown '<Cmd->']
> [keyDown '<Ctrl-À>']
> [keyUp '<Ctrl-À>']
> [keyUp '']
>
> So docking bar activation is not working under windows.
> What do you think about binding the docking bar menus to ctrl-<n> by
> position like:
> ctrl-1 squeak menu
> ctrl-2 Project menu
> etc...
>
> And what do you think in general about using ctrl- keystrokes for
> image wide shortcuts?
> Like ctrl-w always closing the topmost window, not just when the World
> has the keyboard focus.
>
> Balázs

Not a bad idea.

However, I consider keyboard handling in general pretty broken. The VMs are inconsistent, and there is no proper translation layer in the image. That means keyboard handling code cannot be written in a platform-independent way.

Also IMHO shortcuts should match the platform's common usage. E.g. copy/paste should use Ctrl on Windows but Cmd on the Mac. In Etoys we simply enable swapCtrlAndAlt on startup if running on Windows or Unix, but that only goes so far ...

I think I heard that some of this was cleaned up in Pharo - maybe someone can take a peek?

- Bert -


Reply | Threaded
Open this post in threaded view
|

Re: Modifier key events

Andreas.Raab
Bert Freudenberg wrote:
> However, I consider keyboard handling in general pretty broken. The VMs are inconsistent, and there is no proper translation layer in the image. That means keyboard handling code cannot be written in a platform-independent way.
>
> Also IMHO shortcuts should match the platform's common usage. E.g. copy/paste should use Ctrl on Windows but Cmd on the Mac. In Etoys we simply enable swapCtrlAndAlt on startup if running on Windows or Unix, but that only goes so far ...

If we care about this (which I'm not entirely sure about) we should lift
the platform support from Tweak (i.e., the CPlatform classes). They have
platform mappings for all the common shortcuts and it's what we rely on
in our products.

Cheers,
   - Andreas

Reply | Threaded
Open this post in threaded view
|

Re: Modifier key events

Karl Ramberg
Better keyboard handling is requested for Etoys by many users and instructors.
Kids want to make games, even multi-player on the same computer so
getting this right would be appreciated.

Karl

On Thu, Feb 25, 2010 at 2:39 PM, Andreas Raab <[hidden email]> wrote:

> Bert Freudenberg wrote:
>>
>> However, I consider keyboard handling in general pretty broken. The VMs
>> are inconsistent, and there is no proper translation layer in the image.
>> That means keyboard handling code cannot be written in a
>> platform-independent way.
>> Also IMHO shortcuts should match the platform's common usage. E.g.
>> copy/paste should use Ctrl on Windows but Cmd on the Mac. In Etoys we simply
>> enable swapCtrlAndAlt on startup if running on Windows or Unix, but that
>> only goes so far ...
>
> If we care about this (which I'm not entirely sure about) we should lift the
> platform support from Tweak (i.e., the CPlatform classes). They have
> platform mappings for all the common shortcuts and it's what we rely on in
> our products.
>
> Cheers,
>  - Andreas
>
>

Reply | Threaded
Open this post in threaded view
|

Re: Modifier key events

Andreas.Raab
In reply to this post by Bert Freudenberg
On 2/25/2010 2:06 PM, Bert Freudenberg wrote:
> I think I heard that some of this was cleaned up in Pharo - maybe someone can take a peek?

I just did. They took CPlatform from Tweeak and renamed it OSPlatform
(some of the methods still have our original initials on them :-) but
they dropped all the platform shortcut mapping. Instead they're using
duplicateCtrlAndAltCommands (or whatever the preference is called). Not
particularly inspiring.

I might give it a shot when I find some time.

Cheers,
   - Andreas