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
6967749d
Commit
6967749d
authored
Apr 30, 2004
by
Gildas Bazin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* modules/gui/wxwindows/*: hotkeys support.
parent
b099d449
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
54 additions
and
36 deletions
+54
-36
modules/gui/wxwindows/interface.cpp
modules/gui/wxwindows/interface.cpp
+29
-34
modules/gui/wxwindows/menus.cpp
modules/gui/wxwindows/menus.cpp
+18
-1
modules/gui/wxwindows/wxwindows.cpp
modules/gui/wxwindows/wxwindows.cpp
+1
-0
modules/gui/wxwindows/wxwindows.h
modules/gui/wxwindows/wxwindows.h
+6
-1
No files found.
modules/gui/wxwindows/interface.cpp
View file @
6967749d
...
...
@@ -280,7 +280,7 @@ Interface::Interface( intf_thread_t *_p_intf ):
SetDropTarget
(
new
DragAndDrop
(
p_intf
)
);
#endif
UpdateAcceleratorTable
();
SetupHotkeys
();
/* Start timer */
timer
=
new
Timer
(
p_intf
,
this
);
...
...
@@ -702,43 +702,38 @@ void Interface::CreateOurExtendedPanel()
extra_frame
->
Hide
();
}
void
Interface
::
UpdateAcceleratorTable
()
void
Interface
::
SetupHotkeys
()
{
/* Set some hotkeys */
wxAcceleratorEntry
entries
[
7
];
vlc_value_t
val
;
int
i
=
0
;
var_Get
(
p_intf
->
p_vlc
,
"key-quit"
,
&
val
);
entries
[
i
++
].
Set
(
ConvertHotkeyModifiers
(
val
.
i_int
),
ConvertHotkey
(
val
.
i_int
),
Exit_Event
);
var_Get
(
p_intf
->
p_vlc
,
"key-stop"
,
&
val
);
entries
[
i
++
].
Set
(
ConvertHotkeyModifiers
(
val
.
i_int
),
ConvertHotkey
(
val
.
i_int
),
StopStream_Event
);
var_Get
(
p_intf
->
p_vlc
,
"key-play-pause"
,
&
val
);
entries
[
i
++
].
Set
(
ConvertHotkeyModifiers
(
val
.
i_int
),
ConvertHotkey
(
val
.
i_int
),
PlayStream_Event
);
var_Get
(
p_intf
->
p_vlc
,
"key-next"
,
&
val
);
entries
[
i
++
].
Set
(
ConvertHotkeyModifiers
(
val
.
i_int
),
ConvertHotkey
(
val
.
i_int
),
NextStream_Event
);
var_Get
(
p_intf
->
p_vlc
,
"key-prev"
,
&
val
);
entries
[
i
++
].
Set
(
ConvertHotkeyModifiers
(
val
.
i_int
),
ConvertHotkey
(
val
.
i_int
),
PrevStream_Event
);
var_Get
(
p_intf
->
p_vlc
,
"key-faster"
,
&
val
);
entries
[
i
++
].
Set
(
ConvertHotkeyModifiers
(
val
.
i_int
),
ConvertHotkey
(
val
.
i_int
),
FastStream_Event
);
var_Get
(
p_intf
->
p_vlc
,
"key-slower"
,
&
val
);
entries
[
i
++
].
Set
(
ConvertHotkeyModifiers
(
val
.
i_int
),
ConvertHotkey
(
val
.
i_int
),
SlowStream_Event
);
wxAcceleratorTable
accel
(
7
,
entries
);
struct
vlc_t
::
hotkey
*
p_hotkeys
=
p_intf
->
p_vlc
->
p_hotkeys
;
int
i_hotkeys
;
if
(
!
accel
.
Ok
()
)
msg_Err
(
p_intf
,
"invalid accelerator table"
);
/* Count number of hoteys */
for
(
i_hotkeys
=
0
;
p_hotkeys
[
i_hotkeys
].
psz_action
!=
NULL
;
i_hotkeys
++
);
p_intf
->
p_sys
->
i_first_hotkey_event
=
wxID_HIGHEST
+
7000
;
p_intf
->
p_sys
->
i_hotkeys
=
i_hotkeys
;
wxAcceleratorEntry
p_entries
[
i_hotkeys
];
/* Setup the hotkeys as accelerators */
for
(
int
i
=
0
;
p_hotkeys
[
i
].
psz_action
!=
NULL
;
i
++
)
{
p_entries
[
i
].
Set
(
ConvertHotkeyModifiers
(
p_hotkeys
[
i
].
i_key
),
ConvertHotkey
(
p_hotkeys
[
i
].
i_key
),
p_intf
->
p_sys
->
i_first_hotkey_event
+
i
);
}
SetAcceleratorTable
(
accel
);
msg_Dbg
(
p_intf
,
"accelerator table loaded"
);
wxAcceleratorTable
accel
(
i_hotkeys
,
p_entries
);
if
(
!
accel
.
Ok
()
)
{
msg_Err
(
p_intf
,
"invalid accelerator table"
);
}
else
{
SetAcceleratorTable
(
accel
);
msg_Dbg
(
p_intf
,
"accelerator table loaded"
);
}
}
/*****************************************************************************
...
...
modules/gui/wxwindows/menus.cpp
View file @
6967749d
...
...
@@ -97,7 +97,8 @@ enum
AudioMenu_Events
=
wxID_HIGHEST
+
2000
,
VideoMenu_Events
=
wxID_HIGHEST
+
3000
,
NavigMenu_Events
=
wxID_HIGHEST
+
4000
,
PopupMenu_Events
=
wxID_HIGHEST
+
6000
PopupMenu_Events
=
wxID_HIGHEST
+
6000
,
Hotkeys_Events
=
wxID_HIGHEST
+
7000
};
BEGIN_EVENT_TABLE
(
Menu
,
wxMenu
)
...
...
@@ -847,6 +848,8 @@ void MenuEvtHandler::OnShowDialog( wxCommandEvent& event )
void
MenuEvtHandler
::
OnMenuEvent
(
wxCommandEvent
&
event
)
{
wxMenuItem
*
p_menuitem
=
NULL
;
int
i_hotkey_event
=
p_intf
->
p_sys
->
i_first_hotkey_event
;
int
i_hotkeys
=
p_intf
->
p_sys
->
i_hotkeys
;
/* Check if this is an auto generated menu item */
if
(
event
.
GetId
()
<
FirstAutoGenerated_Event
)
...
...
@@ -855,6 +858,20 @@ void MenuEvtHandler::OnMenuEvent( wxCommandEvent& event )
return
;
}
/* Check if this is an hotkey event */
if
(
event
.
GetId
()
>=
i_hotkey_event
&&
event
.
GetId
()
<
i_hotkey_event
+
i_hotkeys
)
{
vlc_value_t
val
;
val
.
i_int
=
p_intf
->
p_vlc
->
p_hotkeys
[
event
.
GetId
()
-
i_hotkey_event
].
i_key
;
/* Get the key combination and send it to the hotkey handler */
var_Set
(
p_intf
->
p_vlc
,
"key-pressed"
,
val
);
return
;
}
if
(
!
p_main_interface
||
(
p_menuitem
=
p_main_interface
->
GetMenuBar
()
->
FindItem
(
event
.
GetId
()))
==
NULL
)
...
...
modules/gui/wxwindows/wxwindows.cpp
View file @
6967749d
...
...
@@ -130,6 +130,7 @@ static int Open( vlc_object_t *p_this )
msg_Err
(
p_intf
,
"out of memory"
);
return
VLC_ENOMEM
;
}
memset
(
p_intf
->
p_sys
,
0
,
sizeof
(
intf_sys_t
)
);
p_intf
->
pf_run
=
Run
;
...
...
modules/gui/wxwindows/wxwindows.h
View file @
6967749d
...
...
@@ -130,6 +130,11 @@ struct intf_sys_t
/* Popup menu */
wxMenu
*
p_popup_menu
;
/* Hotkeys */
int
i_first_hotkey_event
;
int
i_hotkeys
;
/* Embedded vout */
VideoWindow
*
p_video_window
;
wxBoxSizer
*
p_video_sizer
;
};
...
...
@@ -209,7 +214,7 @@ public:
wxGauge
*
volctrl
;
private:
void
UpdateAcceleratorTable
();
void
SetupHotkeys
();
void
CreateOurMenuBar
();
void
CreateOurToolBar
();
void
CreateOurExtendedPanel
();
...
...
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