Thanks for quick response.
I can not make shortcuts buttons function.
I don't think it is focus related.
They don't work (Win32), even in the main ui (Try to change the button text 'Execute' by 'E&xecute')
I don't know why (Iup or the way it is integrated ?)
----
However I discovered that the menus shorcuts works.
So I make a single top level menu with name '&Command'
and add code to execute a command in the clipboard
This is the code modifications in gui.lua for those interested.
-- file gui.lua
-- Main Menu Definition.
menu = {}
menu.mnuMain = iup.menu
{
iup.item{title="&Command", action="execute_clipboard()"}
}
-- Additionnal function to call cli
function execute_clipboard()
local clipboard = iup:clipboard()
local cmd = ''
if clipboard.textavailable then
cmd = clipboard.text
else
iup.Message ("Warning", "Command not found in Clipboard")
return
end
add_status(cli:execute(cmd))
end
-- Modify line 504 in original gui.lua to show menu
-- menu = menu,
menu = menu.mnuMain,
I call this from my application by filling the clipboard with a command, activating chdkptp windows with AppActivate and sending Alt-C keystroke.
This code work but may be enhanced because that I have no skill in lua nor in iup
(Perhaps it's better to use a global variable for clipboard ?, clipboard must be distroyed ? )
I must admit that modfying the ui in lua is awesome !