I'm trying to simulate the way Spotlight works in Yosemite where the NSTextField (search field) always retains focus when hitting the up/down arrow keys and moves the tableview selection up and down. I've implemented the following code: - (BOOL)contr
I need to detect all the keys that the user presses. Using -keyDown: I can get most key presses (alphanumeric, function keys, arrows, space bar, escape, return), but I cannot get any modifier key when it's pressed alone. How do I detect absolutely an
I'd like to capture key events from any window in the application and interpret them as Unicode. For example, if the user types Option-e-e (on a default-configured US English keyboard), I would like to recognize that as "é". I tried capturing ke
Let's say I have a floating, borderless, circular NSWindow. It is circular because the content view simply draws a red circle. That content view needs to be layer-backed ([contentView setWantsLayer:YES]), because I'm applying CoreAnimations on it, e.
I'm trying to find a solution that allows me to get keydown events in a view controller. I do not believe a view controller is part of the responder chain by default. I would appreciate a sample of how to go about this. I have had trouble finding doc
I want to fire a query when a particular record gets selected in an NSTableView, not when the user just scrolls down or scrolls up by continuously pressing UP/DOWN button to reach to a record. My current implementation is if ([notification object] ==
NSEvent keyCode gives a keyboard scan code, which is a hardware specific code representing the physical key. I want to convert the scan code to a virtual key code, which is the logical key based on the users keyboard layout (QWERTY, AZERTY, etc). In
When using NSEvent flagsChanged and ANDing the flags with various KeyMasks, how can you test themin an exclusive way? Currently, using a series of if else conditions whit the pattern: if ((flags & someKeyMask) && (flags someOtherKeyMask)) This
In my application, I want the scrolling to happen, only with scroll wheel action from a mouse and not from the two finger gesture on a trackpad. Basically, I am trying to determine if the scrollWheelEvent is generated from the mouse or trackpad, insi
I have a problem with listening for events, I can listen for events which works perfectly however I can't make it stop listening to events. I researched it for a while and came up with the a method, + (void)removeMonitor:(id)eventMonitor, that it say
I make a iphone remote mouse controller application for Mac: the iPhone application sends the coordinate values to the Mac, which then processes mouse location value. To get the current mouse location on the Mac, the receiver calls [NSEvent mouseLoca
I've been searching the Apple docs and the only function I could find pertaining to a double click just returned the acceptable time between clicks for it to be considered a double click. Can someone please show me an example of a double click event?
I'm trying to implement my own autocomplemention system (result is pull from an sqlite database) I've set up a NSTextField and the appropriate delegate. Each time the text in the NSTextField change, it call - (void)controlTextDidChange:(NSNotificatio
I am trying to automate some tasks (there's no applescript support) so I have to use CGEvents and post these events. Mouse clicking works fine, but NSKeyDown (enter) only works if I click on the app in the dock(which makes it front most app)... Here'
I'm trying to create an OS X keyboard hook for assistive technology purposes (i.e. don't worry, not a keylogger). When a user presses a key, I want to prevent the real keypress and send a fake keypress (character of my choosing) instead. I have the f
Is there a way (without using any undocumented API) to figure out if ANY window (not just the application from which the code is running from) is being dragged? I can use [NSEvent addGlobalMonitorForEventsMatchingMask:] but this is just for general d
Hi I am working on an iphone application and want to handle keyboard events in iphone. In Mac, there is a class NSEvent which handles both keyboard and mouse events, and in ios (iphone/ipad) the counterpart of NSEvent is UIEvent which handles only to
I was wondering if NSEvent responds to the "Shift" key on the keyboard. I am logging the keyCodes when debugging my app and I don't get a keyCode value for the shift key. Thanks, Kevin EDIT: This is the code I am using from a user response. -(vo
I'm updating (downdating?) an application I've written for 10.6+ to work in 10.5+. I'm struggling with capturing the currently pressed mouse button in the -(void)menuWillOpen:(NSMenu *); selector. For 10.6+ I'm taking advantage of the [NSEvent presse
Can someone show an example on how to create an NSEvent that simulates pressing return?You should take a look at the NSEvent Class Reference, and more specifically, -keyEventWithType:location:modifierFlags:timestamp:windowNumber:context:characters:ch
I'm trying to show a pop up menu on mouse down on a button. The button should appear pressed while mouse down, and be "un pressed" on mouse up regardless of any of the menu item been selected. Similar to the Expose/Space Preference panel "+