• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: more NSEvent stuff
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: more NSEvent stuff


  • Subject: Re: more NSEvent stuff
  • From: Henry McGilton <email@hidden>
  • Date: Sun, 4 May 2003 23:04:14 -0700

This is a little bit of a keyDown method from a couple of
my simple little apps (Rulers and Protractors). Adjust to
your taste, as 'they' say . . .

- (void)keyDown:(NSEvent *)theEvent
{
NSString *characters = [theEvent characters];
int key = [characters characterAtIndex: 0];

BOOL movingfromarrows = NO;
float xoffset;
float yoffset;

if (key == NSUpArrowFunctionKey) {
xoffset = 0.0; yoffset = 1.0; movingfromarrows = YES;
} else if (key == NSDownArrowFunctionKey) {
xoffset = 0.0; yoffset = -1.0; movingfromarrows = YES;
} else if (key == NSLeftArrowFunctionKey) {
xoffset = -1.0; yoffset = 0.0; movingfromarrows = YES;
} else if (key == NSRightArrowFunctionKey) {
xoffset = 1.0; yoffset = 0.0; movingfromarrows = YES;
}

. . . whacka whacka whacka . . .
}


Look in the documentation for NSEvent . . .

Best Wishes,
........ Henry



===============================+============================
Henry McGilton | Trilithon Software
Boulevardier, Java Composer | Seroia Research
-------------------------------+----------------------------
mailto:email@hidden | http://www.trilithon.com
|
===============================+============================
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >more NSEvent stuff (From: David Cairns <email@hidden>)

  • Prev by Date: Re: getting the type of an object of a Dictionary
  • Next by Date: Re: getting the type of an object of a Dictionary
  • Previous by thread: Re: more NSEvent stuff
  • Next by thread: NSFormatter Handling BackSpace and Delete
  • Index(es):
    • Date
    • Thread