• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Emulating modifier keys
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Emulating modifier keys


  • Subject: Re: Emulating modifier keys
  • From: Daniel Tapie <email@hidden>
  • Date: Sat, 24 Feb 2007 10:22:37 +0100

OK, for anyone interested, I found another solution by using CGPostKeyboardEvent() when my external keys are depressed or released.

This seems to work like a charm...



On 23 févr. 07, at 18:35, Daniel Tapie wrote:

Hi there,

One of our customers wants to use an external keyboard (XKeys) to simulate certain modifier keys like CTRL, CMD etc...

So, I tried overriding "sendEvent" in my application and my idea was to modify the "modifiers" property of the NSEvent I receive.
However, there are no accessors to do this, so it seems I have to re-create new events by copying the fields of the existing event (using methods like "mouseEventWithType:..."). Of course, I am using different methods depending of the type of event sendEvent receives.
Then, I call [super sendEven:myNewEvent] to pass the "modified" event to the normal chain of responders.


The problem is that it seems some views like the QTMovieViews do not react to my newly formed events (mouseDown events for instance) and completely ignore them. If, instead of creating a new event, I make a copy of the existing one, then everything is ok but of course, I cannot change the modifiers.

So, I have two questions:

1) Is there a way to modify "in place" an existing NSEvent?
2) Is there another way to emulate modifier keys?

Thanks for any clues or pointers anybody might have!



Daniel Tapie

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
40softronmedia.com


This email sent to email@hidden




Daniel Tapie _______________________________________________

Cocoa-dev mailing list (email@hidden)

Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Emulating modifier keys (From: Daniel Tapie <email@hidden>)

  • Prev by Date: Re: Custom NSView That is iChat Chat Log Like
  • Next by Date: Implementing Smart Collections
  • Previous by thread: Emulating modifier keys
  • Next by thread: What does "access" mean for NSAppleScript?
  • Index(es):
    • Date
    • Thread