comparison src/video/cocoa/SDL_cocoakeyboard.m @ 4670:ad4f32e874ee

Added preliminary touch code to SDL_cocoakeyboard.m
author jimtla
date Sat, 24 Jul 2010 22:28:38 +0400
parents 3d91e31fcf71
children 1f0e8f6417d9
comparison
equal deleted inserted replaced
4669:62e6a6e9720b 4670:ad4f32e874ee
28 28
29 #include <Carbon/Carbon.h> 29 #include <Carbon/Carbon.h>
30 30
31 //#define DEBUG_IME NSLog 31 //#define DEBUG_IME NSLog
32 #define DEBUG_IME 32 #define DEBUG_IME
33
34 #define DEBUG_TOUCH NSLog
33 35
34 #ifndef NX_DEVICERCTLKEYMASK 36 #ifndef NX_DEVICERCTLKEYMASK
35 #define NX_DEVICELCTLKEYMASK 0x00000001 37 #define NX_DEVICELCTLKEYMASK 0x00000001
36 #endif 38 #endif
37 #ifndef NX_DEVICELSHIFTKEYMASK 39 #ifndef NX_DEVICELSHIFTKEYMASK
188 // method & constructs appropriate attributed string. 190 // method & constructs appropriate attributed string.
189 - (NSArray *) validAttributesForMarkedText 191 - (NSArray *) validAttributesForMarkedText
190 { 192 {
191 return [NSArray array]; 193 return [NSArray array];
192 } 194 }
195
196 // Touch Code Begins -----------
197
198 - (id)initWithFrame:(CGRect)frame {
199 if (self = [super initWithFrame:frame]) {
200 [self setAcceptsTouchEvents:YES];
201 [self setWantsRestingTouches:YES];
202 DEBUG_TOUCH(@"Initializing Cocoa Touch System....");
203 //DEBUG_TOUCH(@"Accepts Touch events? %@",[self acceptsTouchEvents]);
204 }
205 return self;
206 }
207
208 - (void)touchesBeganWithEvent:(NSEvent *)event {
209 DEBUG_TOUCH(@"Finger Down");
210 }
211 - (void)touchesMovedWithEvent:(NSEvent *)event {
212 DEBUG_TOUCH(@"Finger Moved");
213 }
214 - (void)touchesEndedWithEvent:(NSEvent *)event {
215 DEBUG_TOUCH(@"Finger Up");
216 }
217 - (void)touchesCancelledWithEvent:(NSEvent *)event {
218 DEBUG_TOUCH(@"Finger Cancelled");
219 }
220
221 //Touch Code Ends --------------
222
193 223
194 @end 224 @end
195 225
196 /* This is the original behavior, before support was added for 226 /* This is the original behavior, before support was added for
197 * differentiating between left and right versions of the keys. 227 * differentiating between left and right versions of the keys.