[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
getting Events of NSTextField
- Subject: getting Events of NSTextField
- From: Wade Cosgrove wade@xxxxxxxxxx
- Date: Wed, 3 Jan 2001 11:40:10 -0600
Hi everyone,
I've got a question regarding custom behavior of an NSTextField field, specifically, how to over-ride the default text entry handling. Here's the situation...
When the user presses any key, and the text field has focus, I need to be able to inspect the event and get the keys that were pressed. This sounds simple, all I should have to do is subclass NSTextField and check the event coming into keyDown or keyUp (keyDown doesn't seem to work, but that's a different problem). However, this doesn't work because no event gets passed to the text field if no printable character is pressed. EG: if someone presses only command no event is passed to the text field. Is there a way to inspect the raw event coming into the text field? The only way I've come up with is to check the events coming into the application itself, and if the text field is *listening* for events pass the entire event from the app to the text field so it can process it the way I would like.
If someone has any suggestions or knows of a way to do this in a more "civil" manner I'd appreciate the input. Thanks.
---
Wade Cosgrove
Software Engineer
CE Software, Inc.
wade@xxxxxxxxxx