Hi All
I want to line break using shift+enter in TextField(Control+Enter is working) I don't want to use TextView because using this Enter Key Action is not performing..
Thanks Deepika
Hi All
I want to line break using shift+enter in TextField(Control+Enter is working) I don't want to use TextView because using this Enter Key Action is not performing..
Thanks Deepika
The standard way to do this is option-return, and it works for free.
Alternatively, if a text view would be more appropriate for your app than a text field, then that's what you should use.
I wrote one that can send action messages. Here's the header and the implementation. It's under a BSD license.
Thanks Peter it works I add following in code int flags = [event modifierFlags]; BOOL shift = ( flags & NSShiftKeyMask ) ? YES : NO;
if (([event keyCode] == enterKey1 || [event keyCode] == enterKey2) && !shift) {
window = [self window];
[window makeFirstResponder:[window contentView]];
[NSApp sendAction:action to:target from:self];
}
but now able to set focus on texView after action on textField I was using [textField selecttext];
for TextView I tried [theTextView setSelectedRange: NSMakeRange(0,0)]; but not works