Commit 5a08521e authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Lua: remove the never used hotkeys interface

parent cdc30635
......@@ -125,9 +125,6 @@ vlc_module_begin ()
set_description( N_("Lua Telnet") )
add_shortcut( "luatelnet", "telnet" )
/* add_shortcut( "luahotkeys" ) */
/* add_shortcut( "hotkeys" ) */
add_submodule ()
set_shortname( N_( "Lua Meta Fetcher" ) )
set_description( N_("Fetch meta data using lua scripts") )
......
......@@ -158,7 +158,6 @@ nobase_vlclib_DATA = \
lua/intf/cli.luac \
lua/intf/dummy.luac \
lua/intf/dumpmeta.luac \
lua/intf/hotkeys.luac \
lua/intf/luac.luac \
lua/intf/modules/common.luac \
lua/intf/modules/host.luac \
......@@ -222,7 +221,6 @@ EXTRA_DIST += \
lua/intf/cli.lua \
lua/intf/dummy.lua \
lua/intf/dumpmeta.lua \
lua/intf/hotkeys.lua \
lua/intf/http.lua \
lua/intf/luac.lua \
lua/intf/modules/common.lua \
......
--[==========================================================================[
hotkeys.lua: hotkey handling for VLC
--[==========================================================================[
Copyright (C) 2007 the VideoLAN team
$Id$
Authors: Antoine Cellerier <dionoea at videolan dot org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
--]==========================================================================]
--[==========================================================================[
This is meant to replace modules/control/hotkeys.c
(which will require some changes in the VLC core hotkeys stuff)
--]==========================================================================]
require("common")
--common.table_print(vlc,"vlc.\t")
bindings = {
["Ctrl-q"] = "quit",
["Space"] = "play-pause",
[113] --[[q]] = "quit",
[119] --[[w]] = "demo",
[120] --[[x]] = "demo2",
}
function quit()
print("Bye-bye!")
vlc.misc.quit()
end
function demo()
vlc.osd.icon("speaker")
end
function demo2()
if not channel1 then
channel1 = vlc.osd.channel_register()
channel2 = vlc.osd.channel_register()
end
vlc.osd.message("Hey!",channel1)
vlc.osd.slider( 10, "horizontal", channel2 )
end
function action(func,delta)
return { func = func, delta = delta or 0, last = 0, times = 0 }
end
actions = {
["quit"] = action(quit),
["play-pause"] = action(play_pause),
["demo"] = action(demo),
["demo2"] = action(demo2),
}
action = nil
queue = {}
function action_trigger( action )
print("action_trigger:",tostring(action))
local a = actions[action]
if a then
local ok, msg = pcall( a.func )
if not ok then
vlc.msg.err("Error while executing action `".. tostring(action) .."': "..msg)
end
else
vlc.msg.err("Key `"..key.."' points to unknown action `"..bindings[key].."'.")
end
end
function key_press( var, old, key, data )
print("key_press:",tostring(key))
if bindings[key] then
action_trigger(bindings[key])
else
vlc.msg.err("Key `"..key.."' isn't bound to any action.")
end
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 vlc.misc.lock_and_wait() do
end
-- Clean up
vlc.var.del_callback( vlc.object.libvlc(), "key-pressed", key_press )
--vlc.var.del_callback( vlc.object.libvlc(), "action-triggered", action_trigger )
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment