Re: Background Helper app - brings up UI element, needs CMD-C/X/V
Re: Background Helper app - brings up UI element, needs CMD-C/X/V
- Subject: Re: Background Helper app - brings up UI element, needs CMD-C/X/V
- From: Alex Kac <email@hidden>
- Date: Mon, 28 Sep 2015 15:22:02 -0600
I guess I need more help than that. Here is what I’ve got:
NSViewController - with a NIB that has a plain NSView, with an NSTextField in it. Using an NSPopover, the NSViewController is the content for the popover.
My only two classes are the NSApplication delegate, and the NSViewController. Neither -keyDown nor -performKeyEquivalent: get called there. I’m reading this:
https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/EventOverview/HandlingKeyEvents/HandlingKeyEvents.html
From reading there, since I have no NSWindow, and no NSMenu, there is no key-view loop or NSApplication has nothing to send me the command key equivalents for. I’m wondering if perhaps I need to use a global monitor for events while the popover is up, and remove it when its dismissed.
I don’t mind handling the events myself and processing them - but beyond using a global monitor for events, I’m not sure how to set them up and get them in my NSViewController…
> On Sep 28, 2015, at 2:30 PM, Jens Alfke <email@hidden> wrote:
>
>
>> On Sep 28, 2015, at 1:05 PM, Alex Kac <email@hidden <mailto:email@hidden>> wrote:
>>
>> The problem is that without a menu bar, none of the CMD key functions for text fields works now. Stuff like cut, copy paste. So with that in mind, how do I enable that to work?
>
> You may need to capture the key events (possibly in your view’s -performKeyEquivalent:) and process them yourself.
>
> —Jens
Alex Kac - El capitán
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please 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