An object sent along to your app from macOS that contains information about an input action such as a mouse click or a key press.
Questions tagged [nsevent]
221 questions
0
votes
2 answers
Change NSTextField's behavior for multiple clicks in a row
I have a NSTextField which is nested by a custom view and I want to change the default behavior of multiple clicks in a row (double click, tripple click etc.), similarly to the behavior of text nodes MindNode (see the image below).
I want the first…

Lukáš Kubánek
- 946
- 1
- 15
- 27
0
votes
0 answers
Set keyboard keys only one purpose in Objective-C
I need a little help here to figure out a way to give a keyboard key only one purpose. I explain : Right now, keys 1-8 on the keyboard have an action associate to them with NSEvent and FirstResponder. They call a method. The problem is that I need…

Philippe Champigny
- 59
- 6
0
votes
3 answers
How to use method in a view that i put controls on it from subclass of one of that controls
I subclass a NSTextField and in subclass use an event method (keyUp),i want to call a method in main view (view that i put NSTextFiled on it) when user push Enter key.i use below code but don't how to call specific method in main view
-…
user437064
0
votes
1 answer
How to move the fieldEditor to selected position?
When I tried to edit the column using -(void)editColumn:(NSInteger)column row:(NSInteger)row withEvent:(NSEvent *)theEvent select:(BOOL)select of NSTableView the field editor always comes at the beginning of the NSTextField.I inserted some tab…

Ram
- 1,872
- 5
- 31
- 54
0
votes
1 answer
(BOOL)windowShouldClose:(id)sender doesn't work in view that i set as contentview of mainmenu's window
I set a NSViewController's view as contentview of mainmenu's window,now how should i use - (BOOL)windowShouldClose:(id)sender ?
i use in @interface and put - (BOOL)windowShouldClose:(id)sender on .m but doesn't work
user437064
-1
votes
1 answer
AppKit Reading Keyboard Input in Separate Thread
Is there anyway to read keyboard inputs in AppKit off the main thread? I've managed to do so using CGEventTapCreate but unfortunately it requires permissions I'd rather not have to request. Is there a way to read local inputs off the main…

loats
- 1
- 1
-1
votes
1 answer
How to get key code or key text from an NSEvent in AppleScript with AppKit
I would like to be able to get either the key code or the characters/text from an NSEvent/KeyEvent. Absolutely no idea how to do this as the documentation I have found so far has been very limited.
My script is below. I am working on a speedrun…

Liam Kinghouser
- 1
- 3
-1
votes
2 answers
keydown in objective-C
[UPDATED AFTER FIRST AWNSER]
I have tried to find a way to use and implement the keyDown option in Objective C. But when I try it, it always fails...
Can anyone give me an example of how this is done. I understand Objective C good and a full…

Muttur
- 31
- 2
- 4
-1
votes
1 answer
How to return an undefined value for NSPoint
I am learning swift and I am trying to make a simple app where I move an object (The default ship) with the keyboard. I am designing an event to represent the left keypress. Since I do not need the mouse to be at a specific place, NSLocation is of…

Louis Couture
- 72
- 1
- 9
-1
votes
1 answer
Tracking Duration of Mouse Event
Is there a way to track the time between a mouseDown and a mouseUp event in swift? Or would one have to implement their own tracker manually?

Joel Tecson
- 45
- 6
-1
votes
1 answer
Monitor when app opens file
I am wondering if there is a way to monitor when a user presses open file (cmd+o) in any application.
I was thinking I could use addGlobalMonitorForEvents, but I was not sure how to get the specific on "Open File..." event.

zoecarver
- 5,523
- 2
- 26
- 56