On Aug 16, 2007, at 10:08 PM, James Mahoney wrote:
I guess this question applies to EdenMath and Stepulator as well,
but is there any way to receive input from the keyboard in
Calculator.app? Otherwise, it's pretty tiresome to mouse around to
enter every number and operation.
You'd need to implement/override the keyDown: method, something like
this:
- (void) keyDown: (NSEvent*)theEvent
{
NSString *characters = [theEvent characters];
unichar character = 0;
if ([characters length] > 0)
{
character = [characters characterAtIndex: 0];
/* Figure out which character got pushed and tell that button to
performClick: ... */
}
else
[super keyDown: theEvent];
}
I'm not sure Calculator is organized correctly for that, though. You
generally want to implement the keyDown: method in a view or in the
window's delegate. But it might work OK.
_______________________________________________
Discuss-gnustep mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/discuss-gnustep