David (if your watching :) )
I'm trying to be clever and redirect a key press. The following script is meant to intercept the press of the play button and turn this into a half shutter press. But it doesn't seem to work. The play button responds as if play was pressed. Any ideas where I'm going wrong in this test script?
test_menu = menu.new
{
name = "Show keypress",
choices = { "Off", "On" },
value = "On",
}
function event.keypress(key)
if key == KEY.PLAY and test_menu.value == "On" then
key = UNPRESS_HALFSHUTTER
return true
end
end
Function parameters are "pass by value". Setting them will have no effect on the caller.
David
Thanks. BTW is the custom_picture_taking (arg) functionality working in the Lua event module?
If so how do I use this within a Lua script?
Finally, I assume this is the correct use of the press function in the Lua key module?
key.press(HALFSUTTER)
Cheers
Garry