Commit f2cbd168 authored by jimtla's avatar jimtla

Added preliminary touch code to SDL_cocoakeyboard.m

parent c1e63cf8
...@@ -874,6 +874,7 @@ ...@@ -874,6 +874,7 @@
0C5AF5FD01191D2B7F000001 /* SDL_version.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = SDL_version.h; path = ../../include/SDL_version.h; sourceTree = SOURCE_ROOT; }; 0C5AF5FD01191D2B7F000001 /* SDL_version.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = SDL_version.h; path = ../../include/SDL_version.h; sourceTree = SOURCE_ROOT; };
0C5AF5FE01191D2B7F000001 /* SDL_video.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = SDL_video.h; path = ../../include/SDL_video.h; sourceTree = SOURCE_ROOT; }; 0C5AF5FE01191D2B7F000001 /* SDL_video.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = SDL_video.h; path = ../../include/SDL_video.h; sourceTree = SOURCE_ROOT; };
0C5AF5FF01191D2B7F000001 /* SDL.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = SDL.h; path = ../../include/SDL.h; sourceTree = SOURCE_ROOT; }; 0C5AF5FF01191D2B7F000001 /* SDL.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = SDL.h; path = ../../include/SDL.h; sourceTree = SOURCE_ROOT; };
8C93F0EA11F803710014F54D /* gestureSDLTest-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "gestureSDLTest-Info.plist"; sourceTree = "<group>"; };
8CB0A76A11F6A84800CBA2DE /* SDL_x11clipboard.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_x11clipboard.c; sourceTree = "<group>"; }; 8CB0A76A11F6A84800CBA2DE /* SDL_x11clipboard.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_x11clipboard.c; sourceTree = "<group>"; };
8CB0A76B11F6A84800CBA2DE /* SDL_x11clipboard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_x11clipboard.h; sourceTree = "<group>"; }; 8CB0A76B11F6A84800CBA2DE /* SDL_x11clipboard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_x11clipboard.h; sourceTree = "<group>"; };
8CB0A77611F6A87F00CBA2DE /* SDL_gesture.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_gesture.h; path = ../../include/SDL_gesture.h; sourceTree = SOURCE_ROOT; }; 8CB0A77611F6A87F00CBA2DE /* SDL_gesture.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_gesture.h; path = ../../include/SDL_gesture.h; sourceTree = SOURCE_ROOT; };
...@@ -1591,6 +1592,7 @@ ...@@ -1591,6 +1592,7 @@
BECDF66B0761BA81005FE872 /* Info-Framework.plist */, BECDF66B0761BA81005FE872 /* Info-Framework.plist */,
BEC562FE0761C0E800A33029 /* Linked Frameworks */, BEC562FE0761C0E800A33029 /* Linked Frameworks */,
00D8D9F11195090700638393 /* testsdl-Info.plist */, 00D8D9F11195090700638393 /* testsdl-Info.plist */,
8C93F0EA11F803710014F54D /* gestureSDLTest-Info.plist */,
); );
comments = "To build Universal Binaries, we have experimented with a variety of different options.\nThe complication is that we must retain compatibility with at least 10.2. \nThe Universal Binary defaults only work for > 10.3.9\n\nSo far, we have found:\ngcc 4.0.0 with Xcode 2.1 always links against libgcc_s. gcc 4.0.1 from Xcode 2.2 fixes this problem.\n\nBut gcc 4.0 will not work with < 10.3.9 because we continue to get an undefined symbol to _fprintf$LDBL128.\nSo we must use gcc 3.3 on PPC to accomplish 10.2 support. (But 4.0 is required for i386.)\n\nSetting the deployment target to 10.4 will disable prebinding, so for PPC, we set it less than 10.4 to preserve prebinding for legacy support.\n\nSetting the PPC SDKROOT to /Developers/SDKs/MacOSX10.2.8.sdk will link to 63.0.0 libSystem.B.dylib. Leaving it at current or 10.4u links to 88.1.2. However, as long as we are using gcc 3.3, it doesn't seem to matter as testing has demonstrated both will run. We have decided not to invoke the 10.2.8 SDK because it is not a default installed component with Xcode which will probably cause most people problems. However, rather than deleting the SDKROOT_ppc entry entirely, we have mapped it to 10.4u in case we decide we need to change this setting.\n\nTo use Altivec or SSE, we needed architecture specific flags:\nOTHER_CFLAGS_ppc\nOTHER_CFLAGS_i386\nOTHER_CFLAGS=$(OTHER_CFLAGS_($CURRENT_ARCH))\n\nThe general OTHER_CFLAGS needed to be manually mapped to architecture specific options because Xcode didn't do this automatically for us.\n\n\n"; comments = "To build Universal Binaries, we have experimented with a variety of different options.\nThe complication is that we must retain compatibility with at least 10.2. \nThe Universal Binary defaults only work for > 10.3.9\n\nSo far, we have found:\ngcc 4.0.0 with Xcode 2.1 always links against libgcc_s. gcc 4.0.1 from Xcode 2.2 fixes this problem.\n\nBut gcc 4.0 will not work with < 10.3.9 because we continue to get an undefined symbol to _fprintf$LDBL128.\nSo we must use gcc 3.3 on PPC to accomplish 10.2 support. (But 4.0 is required for i386.)\n\nSetting the deployment target to 10.4 will disable prebinding, so for PPC, we set it less than 10.4 to preserve prebinding for legacy support.\n\nSetting the PPC SDKROOT to /Developers/SDKs/MacOSX10.2.8.sdk will link to 63.0.0 libSystem.B.dylib. Leaving it at current or 10.4u links to 88.1.2. However, as long as we are using gcc 3.3, it doesn't seem to matter as testing has demonstrated both will run. We have decided not to invoke the 10.2.8 SDK because it is not a default installed component with Xcode which will probably cause most people problems. However, rather than deleting the SDKROOT_ppc entry entirely, we have mapped it to 10.4u in case we decide we need to change this setting.\n\nTo use Altivec or SSE, we needed architecture specific flags:\nOTHER_CFLAGS_ppc\nOTHER_CFLAGS_i386\nOTHER_CFLAGS=$(OTHER_CFLAGS_($CURRENT_ARCH))\n\nThe general OTHER_CFLAGS needed to be manually mapped to architecture specific options because Xcode didn't do this automatically for us.\n\n\n";
name = SDLFramework; name = SDLFramework;
......
...@@ -192,6 +192,9 @@ Cocoa_PumpEvents(_THIS) ...@@ -192,6 +192,9 @@ Cocoa_PumpEvents(_THIS)
if ( event == nil ) { if ( event == nil ) {
break; break;
} }
//printf("Type: %i, Subtype: %i\n",[event type],[event subtype]);
switch ([event type]) { switch ([event type]) {
case NSLeftMouseDown: case NSLeftMouseDown:
case NSOtherMouseDown: case NSOtherMouseDown:
...@@ -203,6 +206,7 @@ Cocoa_PumpEvents(_THIS) ...@@ -203,6 +206,7 @@ Cocoa_PumpEvents(_THIS)
case NSRightMouseDragged: case NSRightMouseDragged:
case NSOtherMouseDragged: /* usually middle mouse dragged */ case NSOtherMouseDragged: /* usually middle mouse dragged */
case NSMouseMoved: case NSMouseMoved:
printf("Mouse Type: %i, Subtype: %i\n",[event type],[event subtype]);
Cocoa_HandleMouseEvent(_this, event); Cocoa_HandleMouseEvent(_this, event);
/* Pass through to NSApp to make sure everything stays in sync */ /* Pass through to NSApp to make sure everything stays in sync */
[NSApp sendEvent:event]; [NSApp sendEvent:event];
...@@ -217,8 +221,8 @@ Cocoa_PumpEvents(_THIS) ...@@ -217,8 +221,8 @@ Cocoa_PumpEvents(_THIS)
if (([event modifierFlags] & NSCommandKeyMask) || [event type] == NSFlagsChanged) if (([event modifierFlags] & NSCommandKeyMask) || [event type] == NSFlagsChanged)
[NSApp sendEvent: event]; [NSApp sendEvent: event];
break; break;
case NSBeginTouch: case NSTabletPoint:
printf("Touch Event Received\n"); printf("Tablet Event Received\n");
default: default:
[NSApp sendEvent:event]; [NSApp sendEvent:event];
break; break;
......
...@@ -31,6 +31,8 @@ ...@@ -31,6 +31,8 @@
//#define DEBUG_IME NSLog //#define DEBUG_IME NSLog
#define DEBUG_IME #define DEBUG_IME
#define DEBUG_TOUCH NSLog
#ifndef NX_DEVICERCTLKEYMASK #ifndef NX_DEVICERCTLKEYMASK
#define NX_DEVICELCTLKEYMASK 0x00000001 #define NX_DEVICELCTLKEYMASK 0x00000001
#endif #endif
...@@ -191,6 +193,34 @@ ...@@ -191,6 +193,34 @@
return [NSArray array]; return [NSArray array];
} }
// Touch Code Begins -----------
- (id)initWithFrame:(CGRect)frame {
if (self = [super initWithFrame:frame]) {
[self setAcceptsTouchEvents:YES];
[self setWantsRestingTouches:YES];
DEBUG_TOUCH(@"Initializing Cocoa Touch System....");
//DEBUG_TOUCH(@"Accepts Touch events? %@",[self acceptsTouchEvents]);
}
return self;
}
- (void)touchesBeganWithEvent:(NSEvent *)event {
DEBUG_TOUCH(@"Finger Down");
}
- (void)touchesMovedWithEvent:(NSEvent *)event {
DEBUG_TOUCH(@"Finger Moved");
}
- (void)touchesEndedWithEvent:(NSEvent *)event {
DEBUG_TOUCH(@"Finger Up");
}
- (void)touchesCancelledWithEvent:(NSEvent *)event {
DEBUG_TOUCH(@"Finger Cancelled");
}
//Touch Code Ends --------------
@end @end
/* This is the original behavior, before support was added for /* This is the original behavior, before support was added for
......
SDLTest : touchSimp.c touchPong.c SDLTest : touchSimp.c touchPong.c
gcc gestureSDLTest.c -o gestureSDLTest `sdl-config --cflags --libs` -g gcc gestureSDLTest.c -o gestureSDLTest `sdl-config --cflags --libs` -g
gcc gestureTest.c -o gestureTest `sdl-config --cflags --libs` -g
gcc touchTest.c -o touchTest `sdl-config --cflags --libs` -g
gcc touchSimp.c -o touchSimp `sdl-config --cflags --libs` -g
gcc touchPong.c -o touchPong `sdl-config --cflags --libs` -g
gcc parseDevicesTest.c -o parseDevicesTest -g
SDLTest : touchSimp.c touchPong.c SDLTest : touchSimp.c touchPong.c
gcc touchSimp.c -o touchSimp `sdl-config --cflags --libs` -gSDLTest : gcc gestureSDLTest.c -o gestureSDLTest `sdl-config --cflags --libs` -g
gcc gestureTest.c -o gestureTest `sdl-config --cflags --libs` -g
gcc touchTest.c -o touchTest `sdl-config --cflags --libs` -g
gcc touchSimp.c -o touchSimp `sdl-config --cflags --libs` -g
gcc touchPong.c -o touchPong `sdl-config --cflags --libs` -g gcc touchPong.c -o touchPong `sdl-config --cflags --libs` -g
gcc parseDevicesTest.c -o parseDevicesTest -g
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment