do any of the VMs answer shift shift-lock or caps-lock key events?

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

do any of the VMs answer shift shift-lock or caps-lock key events?

Eliot Miranda-2
 
Hi All,

    I'm adding control key support to the linux VM and naturally am trying to support other meta keys at the same time.  Providing the shift keys is problematic since the image is likely to take a key code for an event with just the shifted metastate as a normal keycode.  So my question, does the Mac VM answer the shift keys as events and if so, how are they encoded when they come in?

best
Eliot
Reply | Threaded
Open this post in threaded view
|

Re: do any of the VMs answer shift shift-lock or caps-lock key events?

johnmci
 
In 4.x and earlier there is no concept of an event for keyboard modifier keys.  Also when Apple shipped cheaper laptops in early 2000 they 
did away with indicating if that was the left or the right shift key... 

That said how this works is we cheat. 
As you know Morphic frantically POLLS for events.   That's fine so we return the current mouse location and the current state of the modifier keys. 
The event loop grabs and processes the modifier key state and the mouse position. 

Therefore if you touch/release a modifier key within a morphic polling cycle then the event logic sees that state change. 

For the 5.x series we pay attention to 
flagsChanged:

Informs the receiver that the user has pressed or released a modifier key (Shift, Control, and so on).

- (void)flagsChanged:(NSEvent *)theEvent


However it appears this state change doesn't flow.  Maybe someone can confirm that for me? 


On 2010-09-09, at 11:14 AM, Eliot Miranda wrote:

Hi All,

    I'm adding control key support to the linux VM and naturally am trying to support other meta keys at the same time.  Providing the shift keys is problematic since the image is likely to take a key code for an event with just the shifted metastate as a normal keycode.  So my question, does the Mac VM answer the shift keys as events and if so, how are they encoded when they come in?

best
Eliot

--
===========================================================================
John M. McIntosh <[hidden email]>   Twitter:  squeaker68882
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
===========================================================================





smime.p7s (5K) Download Attachment