ML Menu interactions

Started by garry23, January 11, 2017, 06:16:42 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

garry23

Just some feedback on ML use.

I have a script running that detects I'm in the ML menu and (on the EOSM) converts the [INFO] button into a dedicated [Q] button, so I can go in and out of the ML menus with ease, ie without touching the screen, eg if I have gloves on.

Here is the relevant redacted part of the script:

if menu.visible then
if key == KEY.INFO then -- sim [Q] test
q_pressed = true
return false
else
return true
end
end


All is OK, until you switch on the intervalometer, whilst staying in the ML menu: then the above code doesn't work.

Strange  ???

garry23

Should have said that the other part of my script looks like this:

function simq(arg)
if q_pressed and menu.visible then
key.press(KEY.Q)
q_pressed = false -- reset
return false
else
return true
end
end

event.shoot_task = simq

a1ex

You should be able to send the Q event directly from the GUI task (no need for a shoot_task hook).

garry23

@A1ex

The strangeness is that the script works fine for every other ML menu, i.e. My keypress using [INFO] button to simulate Q works perefectly. As soon as you switch on the intervalometer in the ML menu, it stops working. Only in that case.

Not sure what you mean by from the GUI task, unless you mean the screen touch and don't wish to use that.

On the EOSM because Q and SET are the same button, you don't have a dedicated Q. Which ISO why I wrote the script.

Bottom line: I'm not 'worried' about the behavior, as I know it exists and can work round it.

a1ex

I mean something like this:


if menu.visible then
if key == KEY.INFO then -- sim [Q] test
key.press(KEY.Q)
return false
else
return true
end
end


The issue is that shoot_task hook doesn't run while the intervalometer is active. Can be changed if it makes sense.

garry23


garry23

@A1ex

Justed tested out your suggestion and it doesn't work. In fact I remembered why I had to go the event.shoot_task route.

The reason, I think, is that I am already 'inside' event.keypress, thus calling key.press(x) wont work.

Or at least it doesn't seem to work, ie cbr error.

Unless you think I'm wrong, I'll go back to just setting the flag inside event.keypress and using that flag in event.shoot_task, and live with the minor intervalometer 'feature' when the ML menu is showing.

Cheers

Garry

a1ex

Minimal example:


-- Open ML submenus with INFO

function test4Q(k)
if k == KEY.INFO and menu.visible then
key.press(KEY.Q)
return false
else
return true
end
end

event.keypress = test4Q


BTW, please don't forget Audionut's advice.

garry23

@A1ex/@Audionut

Forgot the 'Lua guidance' : Sorry.

Also worked out what was going wrong, I had tried what you did but it didn't work: why?

Because, stupidly I was doing this:

function test4Q(key)
if key == KEY.INFO and menu.visible then
key.press(KEY.Q)
return false
else
return true
end
end

event.keypress = test4Q


That is using "key", ie you used "k". I changed it to something else and all is OK.

Many thanks for the help/education.

Cheers

Garry