]> git.sesse.net Git - vlc/commitdiff
Fix rc hotkey command.
authorAntoine Cellerier <dionoea@videolan.org>
Sun, 27 Dec 2009 21:04:10 +0000 (22:04 +0100)
committerAntoine Cellerier <dionoea@videolan.org>
Sun, 27 Dec 2009 21:05:53 +0000 (22:05 +0100)
(accepts full hotkey names or hotkey names without the leading key-)

share/lua/intf/rc.lua

index ff75eb420597239e903b710f21af5809945cf87b..21a104012a53300ad2c6d9e2537033e273703b81 100644 (file)
@@ -446,6 +446,14 @@ function menu(name,client,value)
     end
 end
 
+function hotkey(name, client, value)
+    if not value then
+        client:append("Please specify a hotkey (ie key-quit or quit)")
+    elseif not common.hotkey(value) and not common.hotkey("key-"..value) then
+        client:append("Unknown hotkey '"..value.."'")
+    end
+end
+
 function eval(client,val)
     client:append(tostring(loadstring("return "..val)()))
 end
@@ -507,7 +515,7 @@ commands_ordered = {
     { "vzoom"; { func = skip(listvalue("vout","zoom")); args = "[X]"; help = "set/get video zoom"; aliases = { "zoom" } } };
     { "snapshot"; { func = common.snapshot; help = "take video snapshot" } };
     { "strack"; { func = skip(listvalue("input","spu-es")); args = "[X]"; help = "set/get subtitles track" } };
-    { "hotkey"; { func = skip(common.hotkey); args = "[hotkey name]"; help = "simulate hotkey press"; adv = true; aliases = { "key" } } };
+    { "hotkey"; { func = hotkey; args = "[hotkey name]"; help = "simulate hotkey press"; adv = true; aliases = { "key" } } };
     { "menu"; { func = menu; args = "[on|off|up|down|left|right|select]"; help = "use menu"; adv = true } };
     { "" };
     { "set"; { func = set_env; args = "[var [value]]"; help = "set/get env var"; adv = true } };