Simple CarbonEvent Question
Quote:case kEventRawKeyDown:
GetEventParameter(event, kEventParamKeyMacCharCodes, typeChar, nil,
sizeof(charCode), nil, &charCode);
gKeyState[charCode] = true;
break;
Sorry if im missing a really really easy answer but how do I tell if the return and enter keys have been pressed? I tried checking for "\n" and "\r"
Thanks
Try
#define returnKey 0x0D
if(charcode == returnKey)
#define returnKey 0x0D
if(charcode == returnKey)
uh, 0x0D is '\r'...
From events.h
and so...
Code:
kEnterCharCode = 3,
...
kReturnCharCode = 13,and so...
Code:
char theChar;
GetEventParameter (event, kEventParamKeyMacCharCodes, typeChar, NULL, sizeof(char), NULL, &theChar);
if (theChar == (char)kReturnCharCode || theChar == (char)kEnterCharCode)
{
...
}
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| simple question (private) | imaumac | 9 | 3,396 |
Oct 21, 2008 09:37 PM Last Post: imaumac |
|
| simple Question about movement | bonanza | 3 | 2,707 |
Oct 17, 2007 11:12 AM Last Post: bonanza |
|
| Really simple #pragma question | WhatMeWorry | 9 | 3,690 |
Dec 13, 2006 10:15 PM Last Post: Nick |
|
| Simple OpenGL/Xcode Question. | loopfick | 10 | 5,898 |
Sep 8, 2005 09:54 AM Last Post: Volte |
|
| Simple Animation Question | KiroNeem | 11 | 5,101 |
Nov 20, 2004 09:17 AM Last Post: DoG |
|

