Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libSDL
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PocketInsanity
libSDL
Commits
0893ec9c
Commit
0893ec9c
authored
Dec 02, 2010
by
Sam Lantinga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed touch events on Mac OS X 10.6
parent
d3d39b95
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
3 deletions
+8
-3
SDL_cocoawindow.m
src/video/cocoa/SDL_cocoawindow.m
+8
-3
No files found.
src/video/cocoa/SDL_cocoawindow.m
View file @
0893ec9c
...
@@ -57,11 +57,13 @@ static __inline__ void ConvertNSRect(NSRect *r)
...
@@ -57,11 +57,13 @@ static __inline__ void ConvertNSRect(NSRect *r)
}
else
{
}
else
{
[
_data
->
nswindow
setDelegate
:
self
];
[
_data
->
nswindow
setDelegate
:
self
];
}
}
// FIXME: Why doesn't this work?
// [center addObserver:self selector:@selector(rightMouseDown:) name:[NSString stringWithCString:"rightMouseDown" encoding:NSUTF8StringEncoding] object:[_data->nswindow contentView]];
[
center
addObserver
:
self
selector
:
@selector
(
windowDidHide
:
)
name
:
NSApplicationDidHideNotification
object
:
NSApp
];
[
center
addObserver
:
self
selector
:
@selector
(
windowDidHide
:
)
name
:
NSApplicationDidHideNotification
object
:
NSApp
];
[
center
addObserver
:
self
selector
:
@selector
(
windowDidUnhide
:
)
name
:
NSApplicationDidUnhideNotification
object
:
NSApp
];
[
center
addObserver
:
self
selector
:
@selector
(
windowDidUnhide
:
)
name
:
NSApplicationDidUnhideNotification
object
:
NSApp
];
[
_data
->
nswindow
setAcceptsMouseMovedEvents
:
YES
];
[
_data
->
nswindow
setAcceptsMouseMovedEvents
:
YES
];
#if MAC_OS_X_VERSION_M
IN_REQUIR
ED >= MAC_OS_X_VERSION_10_6
#if MAC_OS_X_VERSION_M
AX_ALLOW
ED >= MAC_OS_X_VERSION_10_6
[[
_data
->
nswindow
contentView
]
setAcceptsTouchEvents
:
YES
];
[[
_data
->
nswindow
contentView
]
setAcceptsTouchEvents
:
YES
];
#endif
#endif
}
}
...
@@ -295,7 +297,7 @@ static __inline__ void ConvertNSRect(NSRect *r)
...
@@ -295,7 +297,7 @@ static __inline__ void ConvertNSRect(NSRect *r)
-
(
void
)
handleTouches
:
(
cocoaTouchType
)
type
withEvent
:
(
NSEvent
*
)
event
-
(
void
)
handleTouches
:
(
cocoaTouchType
)
type
withEvent
:
(
NSEvent
*
)
event
{
{
#if MAC_OS_X_VERSION_M
IN_REQUIR
ED >= MAC_OS_X_VERSION_10_6
#if MAC_OS_X_VERSION_M
AX_ALLOW
ED >= MAC_OS_X_VERSION_10_6
NSSet
*
touches
=
0
;
NSSet
*
touches
=
0
;
NSEnumerator
*
enumerator
;
NSEnumerator
*
enumerator
;
NSTouch
*
touch
;
NSTouch
*
touch
;
...
@@ -357,7 +359,7 @@ static __inline__ void ConvertNSRect(NSRect *r)
...
@@ -357,7 +359,7 @@ static __inline__ void ConvertNSRect(NSRect *r)
touch
=
(
NSTouch
*
)[
enumerator
nextObject
];
touch
=
(
NSTouch
*
)[
enumerator
nextObject
];
}
}
#endif
/* MAC_OS_X_VERSION_M
IN_REQUIR
ED >= MAC_OS_X_VERSION_10_6 */
#endif
/* MAC_OS_X_VERSION_M
AX_ALLOW
ED >= MAC_OS_X_VERSION_10_6 */
}
}
@end
@end
...
@@ -437,6 +439,9 @@ SetupWindowData(_THIS, SDL_Window * window, NSWindow *nswindow, SDL_bool created
...
@@ -437,6 +439,9 @@ SetupWindowData(_THIS, SDL_Window * window, NSWindow *nswindow, SDL_bool created
NSRect
rect
=
[
nswindow
contentRectForFrameRect
:[
nswindow
frame
]];
NSRect
rect
=
[
nswindow
contentRectForFrameRect
:[
nswindow
frame
]];
NSView
*
contentView
=
[[
SDLView
alloc
]
initWithFrame
:
rect
NSView
*
contentView
=
[[
SDLView
alloc
]
initWithFrame
:
rect
listener
:
data
->
listener
];
listener
:
data
->
listener
];
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6
[
contentView
setAcceptsTouchEvents
:
YES
];
#endif
[
nswindow
setContentView
:
contentView
];
[
nswindow
setContentView
:
contentView
];
[
contentView
release
];
[
contentView
release
];
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment