Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
796258ab
Commit
796258ab
authored
Oct 29, 2009
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
LibVLC: add functions to control mouse and keyboard events
parent
15dd4e11
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
53 additions
and
0 deletions
+53
-0
include/vlc/libvlc_media_player.h
include/vlc/libvlc_media_player.h
+33
-0
src/control/media_player.c
src/control/media_player.c
+6
-0
src/control/media_player_internal.h
src/control/media_player_internal.h
+2
-0
src/control/video.c
src/control/video.c
+10
-0
src/libvlc.sym
src/libvlc.sym
+2
-0
No files found.
include/vlc/libvlc_media_player.h
View file @
796258ab
...
@@ -536,6 +536,39 @@ VLC_PUBLIC_API void libvlc_set_fullscreen( libvlc_media_player_t *, int, libvlc_
...
@@ -536,6 +536,39 @@ VLC_PUBLIC_API void libvlc_set_fullscreen( libvlc_media_player_t *, int, libvlc_
*/
*/
VLC_PUBLIC_API
int
libvlc_get_fullscreen
(
libvlc_media_player_t
*
,
libvlc_exception_t
*
);
VLC_PUBLIC_API
int
libvlc_get_fullscreen
(
libvlc_media_player_t
*
,
libvlc_exception_t
*
);
/**
* Enable or disable key press events handling, according to the LibVLC hotkeys
* configuration. By default and for historical reasons, keyboard events are
* handled by the LibVLC video widget.
*
* \note On X11, there can be only one subscriber for key press and mouse
* click events per window. If your application has subscribed to those events
* for the X window ID of the video widget, then LibVLC will not be able to
* handle key presses and mouse clicks in any case.
*
* \warning This function is only implemented for X11 at the moment.
*
* \param mp the media player
* \param on true to handle key press events, false to ignore them.
*/
VLC_PUBLIC_API
void
libvlc_video_set_key_input
(
libvlc_media_player_t
*
mp
,
unsigned
on
);
/**
* Enable or disable mouse click events handling. By default, those events are
* handled. This is needed for DVD menus to work, as well as a few video
* filters such as "puzzle".
*
* \note See also \func libvlc_video_set_key_input().
*
* \warning This function is only implemented for X11 at the moment.
*
* \param mp the media player
* \param on true to handle mouse click events, false to ignore them.
*/
VLC_PUBLIC_API
void
libvlc_video_set_mouse_input
(
libvlc_media_player_t
*
mp
,
unsigned
on
);
/**
/**
* Get current video height.
* Get current video height.
*
*
...
...
src/control/media_player.c
View file @
796258ab
...
@@ -336,6 +336,7 @@ libvlc_media_player_new( libvlc_instance_t *instance, libvlc_exception_t *e )
...
@@ -336,6 +336,7 @@ libvlc_media_player_new( libvlc_instance_t *instance, libvlc_exception_t *e )
mp
->
drawable
.
xid
=
0
;
mp
->
drawable
.
xid
=
0
;
mp
->
drawable
.
hwnd
=
NULL
;
mp
->
drawable
.
hwnd
=
NULL
;
mp
->
drawable
.
nsobject
=
NULL
;
mp
->
drawable
.
nsobject
=
NULL
;
mp
->
keyboard_events
=
mp
->
mouse_events
=
1
;
mp
->
p_libvlc_instance
=
instance
;
mp
->
p_libvlc_instance
=
instance
;
mp
->
p_input_thread
=
NULL
;
mp
->
p_input_thread
=
NULL
;
mp
->
p_input_resource
=
NULL
;
mp
->
p_input_resource
=
NULL
;
...
@@ -596,6 +597,11 @@ void libvlc_media_player_play( libvlc_media_player_t *p_mi,
...
@@ -596,6 +597,11 @@ void libvlc_media_player_play( libvlc_media_player_t *p_mi,
if
(
p_mi
->
drawable
.
nsobject
!=
NULL
)
if
(
p_mi
->
drawable
.
nsobject
!=
NULL
)
var_SetAddress
(
p_input_thread
,
"drawable-nsobject"
,
p_mi
->
drawable
.
nsobject
);
var_SetAddress
(
p_input_thread
,
"drawable-nsobject"
,
p_mi
->
drawable
.
nsobject
);
var_Create
(
p_input_thread
,
"keyboard-events"
,
VLC_VAR_BOOL
);
var_SetBool
(
p_input_thread
,
"keyboard-events"
,
p_mi
->
keyboard_events
);
var_Create
(
p_input_thread
,
"mouse-events"
,
VLC_VAR_BOOL
);
var_SetBool
(
p_input_thread
,
"mouse-events"
,
p_mi
->
mouse_events
);
var_AddCallback
(
p_input_thread
,
"can-seek"
,
input_seekable_changed
,
p_mi
);
var_AddCallback
(
p_input_thread
,
"can-seek"
,
input_seekable_changed
,
p_mi
);
var_AddCallback
(
p_input_thread
,
"can-pause"
,
input_pausable_changed
,
p_mi
);
var_AddCallback
(
p_input_thread
,
"can-pause"
,
input_pausable_changed
,
p_mi
);
var_AddCallback
(
p_input_thread
,
"intf-event"
,
input_event_changed
,
p_mi
);
var_AddCallback
(
p_input_thread
,
"intf-event"
,
input_event_changed
,
p_mi
);
...
...
src/control/media_player_internal.h
View file @
796258ab
...
@@ -50,6 +50,8 @@ struct libvlc_media_player_t
...
@@ -50,6 +50,8 @@ struct libvlc_media_player_t
uint32_t
xid
;
uint32_t
xid
;
uint32_t
agl
;
uint32_t
agl
;
}
drawable
;
}
drawable
;
unsigned
keyboard_events
:
1
;
unsigned
mouse_events
:
1
;
};
};
/* Media player - audio, video */
/* Media player - audio, video */
...
...
src/control/video.c
View file @
796258ab
...
@@ -112,6 +112,16 @@ void libvlc_toggle_fullscreen( libvlc_media_player_t *p_mi,
...
@@ -112,6 +112,16 @@ void libvlc_toggle_fullscreen( libvlc_media_player_t *p_mi,
vlc_object_release
(
p_vout
);
vlc_object_release
(
p_vout
);
}
}
void
libvlc_video_set_key_input
(
libvlc_media_player_t
*
p_mi
,
unsigned
on
)
{
p_mi
->
keyboard_events
=
!!
on
;
}
void
libvlc_video_set_mouse_input
(
libvlc_media_player_t
*
p_mi
,
unsigned
on
)
{
p_mi
->
mouse_events
=
!!
on
;
}
void
void
libvlc_video_take_snapshot
(
libvlc_media_player_t
*
p_mi
,
const
char
*
psz_filepath
,
libvlc_video_take_snapshot
(
libvlc_media_player_t
*
p_mi
,
const
char
*
psz_filepath
,
unsigned
int
i_width
,
unsigned
int
i_height
,
libvlc_exception_t
*
p_e
)
unsigned
int
i_width
,
unsigned
int
i_height
,
libvlc_exception_t
*
p_e
)
...
...
src/libvlc.sym
View file @
796258ab
...
@@ -200,6 +200,8 @@ libvlc_video_set_crop_geometry
...
@@ -200,6 +200,8 @@ libvlc_video_set_crop_geometry
libvlc_video_set_deinterlace
libvlc_video_set_deinterlace
libvlc_video_set_marquee_option_as_int
libvlc_video_set_marquee_option_as_int
libvlc_video_set_marquee_option_as_string
libvlc_video_set_marquee_option_as_string
libvlc_video_set_key_input
libvlc_video_set_mouse_input
libvlc_video_set_scale
libvlc_video_set_scale
libvlc_video_set_spu
libvlc_video_set_spu
libvlc_video_set_subtitle_file
libvlc_video_set_subtitle_file
...
...
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