Re: Help with text input

2010-04-30 Thread Bill Appleton
mine too :) On Fri, Apr 30, 2010 at 10:13 AM, Charles Srstka wrote: > On Apr 30, 2010, at 12:07 PM, Bill Appleton wrote: > > > wow thanks everyone so much > > > > this is working great! > > No problem. World Builder was one of my favorite things of my childhood. > :-) > > Charles > ___

Re: Help with text input

2010-04-30 Thread Charles Srstka
On Apr 30, 2010, at 12:07 PM, Bill Appleton wrote: > wow thanks everyone so much > > this is working great! No problem. World Builder was one of my favorite things of my childhood. :-) Charles ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) P

Re: Help with text input

2010-04-30 Thread Bill Appleton
wow thanks everyone so much this is working great! On Fri, Apr 30, 2010 at 10:04 AM, Douglas Davidson wrote: > > On Apr 30, 2010, at 9:59 AM, Charles Srstka wrote: > > > On Apr 30, 2010, at 11:41 AM, Douglas Davidson wrote: > > > >> Here is the normal sequence when a text-handling view recei

Re: Help with text input

2010-04-30 Thread Douglas Davidson
On Apr 30, 2010, at 9:59 AM, Charles Srstka wrote: > On Apr 30, 2010, at 11:41 AM, Douglas Davidson wrote: > >> Here is the normal sequence when a text-handling view receives key events: >> the keyDown: method passes events to interpretKeyEvents:, which is where >> they enter key binding and

Re: Help with text input

2010-04-30 Thread Charles Srstka
On Apr 30, 2010, at 11:41 AM, Douglas Davidson wrote: > Here is the normal sequence when a text-handling view receives key events: > the keyDown: method passes events to interpretKeyEvents:, which is where they > enter key binding and input management. They come out either as insertText: > or

Re: Help with text input

2010-04-30 Thread Charles Srstka
On Apr 30, 2010, at 11:40 AM, Bill Appleton wrote: > yep, i'm working on that > > stupid questions: > > do i have to gather & append key events into my array? your example just > sends the current event, so if i do option-key-whatever with multiple key > events will that work? Nope, the text

Re: Help with text input

2010-04-30 Thread Douglas Davidson
On Apr 30, 2010, at 9:32 AM, Charles Srstka wrote: > On Apr 30, 2010, at 11:08 AM, Bill Appleton wrote: > >> don't i need to use interpretKeyEvents to gather the key events until >> insertText is called? > > Yep, just do something like this: > > - (void)keyDown:(NSEvent *)theEvent { >[self

Re: Help with text input

2010-04-30 Thread Bill Appleton
yep, i'm working on that stupid questions: do i have to gather & append key events into my array? your example just sends the current event, so if i do option-key-whatever with multiple key events will that work? and do i need to release the array? you are just sending a new array to interpretke

Re: Help with text input

2010-04-30 Thread Charles Srstka
On Apr 30, 2010, at 11:08 AM, Bill Appleton wrote: > don't i need to use interpretKeyEvents to gather the key events until > insertText is called? Yep, just do something like this: - (void)keyDown:(NSEvent *)theEvent { [self interpretKeyEvents:[NSArray arrayWithObject:theEvent]]; [NSCurs

Re: Help with text input

2010-04-30 Thread Charles Srstka
On Apr 30, 2010, at 10:48 AM, Bill Appleton wrote: > one issue is that the old carbon kEventTextInputUnicodeForKeyEvent delivered > typed characters that should be inserted into (say) of text field > > the new [event characters] method delivers ALL keys -- so for example, an > arrow key gets a un

Re: Help with text input

2010-04-30 Thread Bill Appleton
hi all, don't i need to use interpretKeyEvents to gather the key events until insertText is called? wow there is very little information on that thx bill On Fri, Apr 30, 2010 at 8:55 AM, Shawn Erickson wrote: > On Fri, Apr 30, 2010 at 8:48 AM, Bill Appleton > wrote: > > hi all, > > >

Re: Help with text input

2010-04-30 Thread Shawn Erickson
On Fri, Apr 30, 2010 at 8:48 AM, Bill Appleton wrote: > hi all, > > this is great, thanks for the help. > > one issue is that the old carbon kEventTextInputUnicodeForKeyEvent delivered > typed characters that should be inserted into (say) of text field > > the new [event characters] method deliver

Re: Help with text input

2010-04-30 Thread Bill Appleton
hi all, this is great, thanks for the help. one issue is that the old carbon kEventTextInputUnicodeForKeyEvent delivered typed characters that should be inserted into (say) of text field the new [event characters] method delivers ALL keys -- so for example, an arrow key gets a unicode equivalent

Re: Help with text input

2010-04-30 Thread Shawn Erickson
On Fri, Apr 30, 2010 at 7:12 AM, Bill Appleton wrote: > hi all, > > thanks for the help > > the characters message gives me the unicode output, that is working fine > > but i am unsure how to detect raw keys, like arrow keys, function keys, etc Take a look in NSEvent.h for various helpful constan

Re: Help with text input

2010-04-30 Thread Paul Sanders
> what is the best way on cocoa to determin raw key (physical key) input? http://developer.apple.com/mac/library/documentation/cocoa/reference/ApplicationKit/Classes/NSEvent_Class/Reference/Reference.html#//apple_ref/doc/uid/2016-keyCode and: http://developer.apple.com/mac/library/documentat

Re: Help with text input

2010-04-30 Thread Bill Appleton
hi Graham, in my case i have to implement a scripting language that receives the key names like "up" "f12" "shift" "home" etc. so i agree it is strange but i need to know the physical key presses its like a video game problem thx bill On Fri, Apr 30, 2010 at 7:15 AM, Graham Cox wrot

Re: Help with text input

2010-04-30 Thread Graham Cox
On 01/05/2010, at 12:12 AM, Bill Appleton wrote: > what is the best way on cocoa to determin raw key (physical key) input? > I don't know, but I wonder if this is the right question. If you look at the methods of NSResponder, you'll see that most functional keys are detected and converted to

Re: Help with text input

2010-04-30 Thread Bill Appleton
hi all, thanks for the help the characters message gives me the unicode output, that is working fine but i am unsure how to detect raw keys, like arrow keys, function keys, etc in carbon/event manager there was charCodeMask and keyCodeMask which determined this stuff what is the best way on co

Re: Help with text input

2010-04-29 Thread Douglas Davidson
On Apr 29, 2010, at 5:26 PM, Charles Srstka wrote: > On Apr 29, 2010, at 5:38 PM, Jens Alfke wrote: > >> - (void) keyDown: (NSEvent*)event { >> event.characters; >> event.isARepeat; >> } > > I don’t think that will do the special characters that you can type via the > Option key. Wha

Re: Help with text input

2010-04-29 Thread Charles Srstka
On Apr 29, 2010, at 5:38 PM, Jens Alfke wrote: > - (void) keyDown: (NSEvent*)event { > event.characters; > event.isARepeat; > } I don’t think that will do the special characters that you can type via the Option key. What you want to do is to make your text view conform to the NSText

Re: Help with text input

2010-04-29 Thread Jens Alfke
On Apr 29, 2010, at 3:06 PM, Bill Appleton wrote: i have been looking in NSResponder and see some of this, but how do i get the higher level messages like the unicode string and key repeats ? - (void) keyDown: (NSEvent*)event { event.characters; event.isARepeat; } —Jens

Help with text input

2010-04-29 Thread Bill Appleton
hi all, under carbon events i had text messages like: kEventClassTextInput, with kEventTextInputUnicodeForKeyEvent --> this let me get entire unicode strings that were the result of multiple key presses kEventClassKeyboard with kEventRawKeyModifiersChanged: kEventRawKeyDown: kEventRawKeyUp: