[Vm-dev] OSX VM doesn't generate events for modifier keypresses (shift, ctrl, etc)

Esteban Lorenzano estebanlm at gmail.com
Fri Nov 28 18:42:46 UTC 2014


> On 28 Nov 2014, at 19:29, Esteban Lorenzano <estebanlm at gmail.com> wrote:
> 
>> 
>> On 28 Nov 2014, at 19:27, Eliot Miranda <eliot.miranda at gmail.com> wrote:
>> 
>> 
>> 
>> Hi Both,
>> 
>> On Nov 28, 2014, at 9:19 AM, Esteban Lorenzano <estebanlm at gmail.com> wrote:
>> 
>>> 
>>> you don’t
>>> they do not maintain a osx-cocoa version, so your changes are useless for them. 
>> 
>> On the contrary.  As soon as possible I want to upgrade to 10.10 and that means Cocoa.  Right now I'm concentrating on Spur 64 bits.  But soon time may be available.  So Ben please send a change set if you can.
>> 
>> IIRC John McIntosh wrote the Cocoa integration and it is in the squeak tree.  It could do with more love but it exists and soon enough I'll be building it.
> 
> 
> yeah, but that was like 3yr ago… sources changed quite a lot in the mean time. 
> Going to cocoa will mean take back the full tree, not just the changes. 

ah, but is super cool that you want to move to cocoa soon :)
so, let me know how can I help you in the process. 

> 
> Esteban
> 
>> 
>>> 
>>> Esteban 
>>> 
>>>> On 28 Nov 2014, at 18:09, Ben Coman <btc at openInWorld.com> wrote:
>>>> 
>>>> I celebrate my first VM contribution :) :) :) with integration of [1] into pharo-vm on github.  Now how do I submit this for consideration for the SVN tree, to help keep things in syncd.
>>>> cheers -ben
>>>> 
>>>> Ben Coman wrote:
>>>>> AliakseiSyrel reported that the OSX VM doesn't generate events on shift/ctrl/command/options/capslock keypress, but Win32 and Linux do.
>>>>> (https://pharo.fogbugz.com/default.asp?14521)
>>>>> I've submitted a fix to pharo-vm, but thought it might also be useful to others, and was hoping for some review and discussion here...
>>>> 
>>>>> A diff can be seen here...
>>>>> [1] https://github.com/pharo-project/pharo-vm/pull/67/files
>>>> 
>>>>> I discovered "recordCharEvent:fromView:" and "keyDown:" do not receive modifier keypresses, however "flagsChanged:" does - as described by the AppKit Reference "flagsChanged: informs the receiver that the user has pressed or released a modifier key (Shift, Control, and so on)."
>>>>> Just above "flagsChanged:" I noticed...
>>>>> -(void)keyUp:(NSEvent*)theEvent {
>>>>>     [(sqSqueakOSXApplication *) gDelegateApp.squeakApplication
>>>>>         recordKeyUpEvent: theEvent fromView: self];
>>>>> }
>>>>> So I duplicated recordKeyUpEvent:fromView:
>>>>> as recordKeyDownEvent:fromView:
>>>>> changing only...
>>>>>     evt.pressCode = EventKeyUp;
>>>>> to...
>>>>>     evt.pressCode = EventKeyDown;
>>>>> and called it from the bottom of flagsChanged:
>>>>> ============
>>>>> Now in a test image, adding a debug Transcript after primGetNextEvent:
>>>>> InputEventFetcher>>eventLoop
>>>>>     ...
>>>>> [true] whileTrue: [
>>>>>     self waitForInput.
>>>>>     [self primGetNextEvent: eventBuffer.
>>>>>         Transcript crShow: Time now ; tab ; show: eventBuffer.
>>>>> shows...
>>>>> 11:41:18.9594 pm    #(2 182714 56 1 1 0 0 1) Shift down
>>>>> 11:41:18.959581 pm    #(0 0 0 0 0 0 0 0)
>>>>> 11:41:19.19321 pm    #(2 182948 56 1 0 0 0 1) Shift up
>>>>> 11:41:19.193543 pm    #(0 0 0 0 0 0 0 0)
>>>>> 11:41:21.04326 pm    #(2 184798 59 1 2 0 0 1) Control down
>>>>> 11:41:21.043494 pm    #(0 0 0 0 0 0 0 0)
>>>>> 11:41:21.346713 pm    #(2 185102 59 1 0 0 0 1) Control up
>>>>> 11:41:21.346934 pm    #(0 0 0 0 0 0 0 0)
>>>>> 11:41:21.814845 pm    #(2 185569 58 1 4 0 0 1) Option down
>>>>> 11:41:21.815136 pm    #(0 0 0 0 0 0 0 0)
>>>>> 11:41:22.137117 pm    #(2 185892 58 1 0 0 0 1) Option up
>>>>> 11:41:22.137374 pm    #(0 0 0 0 0 0 0 0)
>>>>> 11:43:28.593666 pm    #(2 312348 55 1 8 0 0 1) Cmd down
>>>>> 11:43:28.593854 pm    #(0 0 0 0 0 0 0 0)
>>>>> 11:43:29.014829 pm    #(2 312770 55 1 0 0 0 1) Cmd up
>>>>> 11:43:29.015011 pm    #(0 0 0 0 0 0 0 0)
>>>>> 11:41:43.762799 pm    #(2 207517 57 1 0 0 0 1) CapsLock down
>>>>> CapsLock does not get a up-event per...
>>>>> https://bugzilla.mozilla.org/show_bug.cgi?id=259059
>>>>> It perhaps can be simulated like...
>>>>> https://developer.apple.com/library/mac/qa/qa1519/_index.html
>>>>> Thoughts?

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


More information about the Vm-dev mailing list