Page 1 of 1

So, how to implement hotkeys without add_callback?

Posted: 01 May 2014 17:37
by roland1
Hello forum, hello Lua fraction in special.
I guess Xubuntu has updated vlc to sth like 2.1+ and my extension (creating cutlists, which I use from time to time) broke:
"attempt to call field 'add_callback' (a nil value)"

What can I try? (downgrading is not an option)

Maybe someone is also willing to explain why it was removed. Does this feature disturb vlc even if not called in a script?

best regards

edit:
there was already a topic (I've not seen, sorry):
https://forum.videolan.org/viewtopic.php?f=29&t=115450

Re: So, how to implement hotkeys without add_callback?

Posted: 05 May 2014 14:37
by mederi
You cannot implement hotkeys without add_callback in VLC-2.1+. You can only use dialog box with buttons in extension scripts.

Re: So, how to implement hotkeys without add_callback?

Posted: 06 May 2014 19:40
by roland1
Thx for response.

Then, is it possible to activate e.g. utton with alt+b when the dialog-box has focus?
(If this was to cryptic: Is there a way to give a button an alt+character hotkey (or similar)?)

Re: So, how to implement hotkeys without add_callback?

Posted: 07 May 2014 11:39
by mederi
Perhaps you could use some external helper (AutoHotkey, AutoIt, VBS).
http://stackoverflow.com/questions/1601 ... -xpos-ypos

Re: So, how to implement hotkeys without add_callback?

Posted: 07 May 2014 12:54
by roland1
I am a big fan of autohotkey and I can read/interpret the input-devices on my Linux machine (at least, given read permission) but this would add too much complexity, IMHO.
If someone knows a way to bind alt+key to a button (as other windows are able to) (or any other internal solution) please share it.
In the meantime, I will search for sth more api stable:p
regards and thx to mederi for taking time and keeping up this forum
EDIT:
on my machine this works, i.e. alt+m activates MyButton (when dialog-box has focus):
----------------------------------
local dlg = vlc.dialog"my_dialog"
local button = dlg:add_button("&MyButton", my_callback, 1, 4, 4, 1)
----------------------------------
Now, I hope this feature remains some years in vlc.
This workaround provides at least restricted hotkey capabilities, but is not a full replacement for add_callback of course.

Re: So, how to implement hotkeys without add_callback?

Posted: 07 May 2014 21:09
by mederi
Thank you for the information. Ampersand in the name of a button really does the trick.