Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
8cb56e31
Commit
8cb56e31
authored
Aug 03, 2010
by
Rémi Duraffort
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lua: fix hotkeys demo file.
parent
502a2fa8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
22 deletions
+6
-22
share/lua/intf/hotkeys.lua
share/lua/intf/hotkeys.lua
+6
-22
No files found.
share/lua/intf/hotkeys.lua
View file @
8cb56e31
...
...
@@ -39,7 +39,7 @@ bindings = {
function
quit
()
print
(
"Bye-bye!"
)
vlc
.
quit
()
vlc
.
misc
.
quit
()
end
function
demo
()
...
...
@@ -74,22 +74,16 @@ function action_trigger( action )
print
(
"action_trigger:"
,
tostring
(
action
))
local
a
=
actions
[
action
]
if
a
then
local
date
=
vlc
.
misc
.
mdate
()
if
a
.
delta
and
date
>
a
.
last
+
a
.
delta
then
a
.
times
=
0
else
a
.
times
=
a
.
times
+
1
local
ok
,
msg
=
pcall
(
a
.
func
)
if
not
ok
then
vlc
.
msg
.
err
(
"Error while executing action `"
..
tostring
(
action
)
..
"': "
..
msg
)
end
a
.
last
=
date
table.insert
(
queue
,
action
)
vlc
.
misc
.
signal
()
else
vlc
.
msg
.
err
(
"Key `"
..
key
..
"' points to unknown action `"
..
bindings
[
key
]
..
"'."
)
end
end
function
key_press
(
var
,
old
,
new
,
data
)
local
key
=
new
function
key_press
(
var
,
old
,
key
,
data
)
print
(
"key_press:"
,
tostring
(
key
))
if
bindings
[
key
]
then
action_trigger
(
bindings
[
key
])
...
...
@@ -101,17 +95,7 @@ end
vlc
.
var
.
add_callback
(
vlc
.
object
.
libvlc
(),
"key-pressed"
,
key_press
)
--vlc.var.add_callback( vlc.object.libvlc(), "action-triggered", action_trigger )
while
not
die
do
if
#
queue
~=
0
then
local
action
=
actions
[
queue
[
1
]]
local
ok
,
msg
=
pcall
(
action
.
func
)
if
not
ok
then
vlc
.
msg
.
err
(
"Error while executing action `"
..
queue
[
1
]
..
"': "
..
msg
)
end
table.remove
(
queue
,
1
)
else
die
=
vlc
.
misc
.
lock_and_wait
()
end
while
not
vlc
.
misc
.
lock_and_wait
()
do
end
-- Clean up
...
...
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