nsevent Questions

2

Solved

In Swift: I created a simple NSView and now want to execute different functions, depending on which mouseButton is pressed (left or right). how can I detect this?
Trappist asked 28/1, 2015 at 20:22

5

Solved

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 scrollWhe...
Marsden asked 10/12, 2012 at 19:17

3

Solved

I have an NSView that is catching a mouseDown event. I'm getting the coordination of the mouse click using: - (void)mouseDown:(NSEvent *)theEvent { NSPoint touchPoint = [NSEvent mouseLocation]; ...
Viguerie asked 21/5, 2014 at 15:37

4

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 loca...
Lobotomy asked 20/11, 2011 at 14:15

1

Solved

I've been trying to determine (from within the event handler) which keyboard triggered the event. I've been using these two posts: http://www.cocoabuilder.com/archive/cocoa/229902-which-keyboard...
Exospore asked 22/5, 2015 at 10:33

4

Solved

I just experimented with the addLocalMonitorForEventsMatchingMask:handler: method in NSEvent and came across the following question: How do I find out if only certain modifiers were pressed? A sho...
Guilty asked 21/5, 2011 at 20:25

3

Solved

In some apps, it makes sense for the app to directly handle keyboard shortcuts which are otherwise bound to system wide combinations. For example, ⌘-Space (normally Spotlight) or ⌘-Tab (normally ap...
Illative asked 10/6, 2017 at 11:39

2

Solved

In an app I'm developing, a database is used to store all user data, usually located somewhere in Library/Application Support. In order to enable the user to switch the database, I want to implemen...
Bihari asked 12/5, 2015 at 17:32

3

Solved

I can recognize when the user presses any Shift key with this code: -(void)flagsChanged:(NSEvent *)theEvent { if ([theEvent modifierFlags] & NSShiftKeyMask) //. . . } but is there any way ...
Selhorst asked 23/5, 2012 at 8:9

2

Solved

I'm currently developing a cross plattform application for iOS and macOS that makes your iOS device function as a track pad. Using CGDisplayMoveCursorToPoint, I can move the cursor on the screen. ...
Magdaleno asked 15/3, 2017 at 14:53

1

Solved

I have tried KeyDown and NSEvent, but they require a NSWindow object to be active. My hope is that I can put an app on the status bar and alert the user when it has pressed CapsLock, even if the us...
Saurischian asked 4/1, 2020 at 12:36

3

Solved

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 key...
Capability asked 26/4, 2011 at 3:37

5

Solved

I need fixed-size NSTextViews inside a larger scrolling window. IB requires that the textviews be inside their own NSScrollViews, even though their min/max sizes are fixed so that they won’t actual...
Footstone asked 9/6, 2011 at 17:40

1

I'm working on a MacOS menu bar app which needs to track some global shortcuts in order to facilitate adjusting display brightness on external monitors. However, I cannot get it to fire a handler o...
Variform asked 8/4, 2018 at 9:29

2

Solved

I’m building a status bar app and want to call different actions depending on if the user clicked left or right. Here’s what I have so far: var statusItem = NSStatusBar.system().statusItem(withLen...
Saucepan asked 17/8, 2016 at 14:39

1

Solved

I am working on a macOS app and I would like to handle a local hotkey event (command + up arrow key) in a NSViewController. Here's how I do it with Swift: override func keyDown(with event: NSEven...
Trapeziform asked 6/4, 2017 at 12:7

2

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 dow...
Aliment asked 10/3, 2015 at 14:55

0

I'm pretty new in OS X programming and I'm trying to write an application that will capture Force Click event at system-wide context. Based on various sources I wrote down code listed below: var ...
Bugloss asked 18/4, 2015 at 11:58

3

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 ...
Genous asked 17/10, 2013 at 21:28

1

I’m trying to replicate the behaviour of the search field in iTunes, for looking up stock symbols and names. Specifically, as you start typing in the search field a popover appears with the filtere...
Cinderella asked 22/12, 2013 at 14:49

2

Solved

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 lik...
Derrek asked 21/3, 2014 at 18:23

2

Solved

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...
Average asked 23/8, 2013 at 17:29

3

In the code below I am Initialising a NSViewController [a NSResponder], with a NSWindow, a NSOpenGLView, presenting the view and attempting to set the NSViewController as the windows first responde...
Rearward asked 19/9, 2011 at 18:13

2

Solved

I have an NSView which covers its parent window's content view. This view has a click event handler which removes it from the content view. Inside this view, I have another view. When I drag the mo...
Tamanaha asked 6/7, 2011 at 1:55

2

Solved

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...
Trimer asked 19/8, 2012 at 23:28

© 2022 - 2024 — McMap. All rights reserved.