Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
2a2b4783
Commit
2a2b4783
authored
Apr 22, 2007
by
Pierre d'Herbemont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Mac OS X gui: Use the proper vlc infrastructure to send mouse wheel event.
parent
3af039a0
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
16 deletions
+23
-16
modules/gui/macosx/controls.h
modules/gui/macosx/controls.h
+1
-0
modules/gui/macosx/controls.m
modules/gui/macosx/controls.m
+19
-0
modules/gui/macosx/vout.m
modules/gui/macosx/vout.m
+3
-16
No files found.
modules/gui/macosx/controls.h
View file @
2a2b4783
...
...
@@ -83,6 +83,7 @@
-
(
BOOL
)
isFullscreen
;
-
(
IBAction
)
windowAction
:(
id
)
sender
;
-
(
BOOL
)
keyEvent
:(
NSEvent
*
)
o_event
;
-
(
void
)
scrollWheel
:(
NSEvent
*
)
theEvent
;
-
(
void
)
setupVarMenuItem
:(
NSMenuItem
*
)
o_mi
target
:(
vlc_object_t
*
)
p_object
...
...
modules/gui/macosx/controls.m
View file @
2a2b4783
...
...
@@ -38,6 +38,7 @@
#import "controls.h"
#import "playlist.h"
#include <vlc_osd.h>
#include <vlc_keys.h>
/*****************************************************************************
* VLCControls implementation
...
...
@@ -464,6 +465,24 @@
}
-
(
void
)
scrollWheel
:(
NSEvent
*
)
theEvent
{
intf_thread_t
*
p_intf
=
VLCIntf
;
float
f_absvalue
=
[
theEvent
deltaY
]
>
0
.
0
f
?
[
theEvent
deltaY
]
:
-
[
theEvent
deltaY
];
int
i
,
i_vlckey
;
f_absvalue
=
f_absvalue
/
2
.
0
f
+
1
.
0
f
;
if
([
theEvent
deltaY
]
<
0
.
0
f
)
i_vlckey
=
KEY_MOUSEWHEELDOWN
;
else
i_vlckey
=
KEY_MOUSEWHEELUP
;
/* Send multiple key event, depending on the intensity of the event */
for
(
i
=
0
;
i
<
(
int
)
f_absvalue
;
i
++
)
var_SetInteger
(
p_intf
->
p_libvlc
,
"key-pressed"
,
i_vlckey
);
}
-
(
BOOL
)
keyEvent
:(
NSEvent
*
)
o_event
{
BOOL
eventHandled
=
NO
;
...
...
modules/gui/macosx/vout.m
View file @
2a2b4783
...
...
@@ -442,22 +442,7 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable,
-
(
void
)
scrollWheel
:(
NSEvent
*
)
theEvent
{
VLCControls
*
o_controls
=
(
VLCControls
*
)[[
NSApp
delegate
]
getControls
];
float
f_absvalue
=
[
theEvent
deltaY
]
>
0
.
0
f
?
[
theEvent
deltaY
]
:
-
[
theEvent
deltaY
];
int
i
;
f_absvalue
/=
2
.
0
f
;
f_absvalue
+=
1
.
0
f
;
/* Set the volume */
if
(
f_absvalue
>
1
.
1
f
)
{
for
(
i
=
0
;
i
<
(
int
)
f_absvalue
;
i
++
)
{
if
([
theEvent
deltaY
]
<
0
.
0
f
)
[
o_controls
volumeDown
:
self
];
else
[
o_controls
volumeUp
:
self
];
}
}
[
o_controls
scrollWheel
:
theEvent
];
}
-
(
void
)
keyDown
:(
NSEvent
*
)
o_event
...
...
@@ -960,6 +945,8 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable,
[
self
scaleWindowWithFactor
:
1
.
0
animate
:
[
o_window
isVisible
]
&&
(
!
[
o_window
isFullscreen
])];
[
o_window
setAspectRatio
:
NSMakeSize
([
o_window
frame
].
size
.
width
,
[
o_window
frame
].
size
.
height
)];
/* Make sure our window is visible, if we are not in fullscreen */
if
(
!
[
o_window
isFullscreen
])
[
o_window
makeKeyAndOrderFront
:
self
];
...
...
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