Wikia

CHDK Wiki

Lua/Lua Reference/Levent

Talk0
575pages on
this wiki

< Lua | Lua Reference

Revision as of 22:33, January 25, 2011 by Tylerritchie (Talk | contribs)

Lua interface to LogicalEvent functions

These functions are only implemented in Lua, not ubasic.

get_levent_def(event)

event is an event id number or string name

returns three values (name, id, param) if index is valid, otherwise nil

  • name string name of the event, possibly the empty string.
  • id event id number
  • param third value in event table

get_levent_index(event)

event is an event id number or string name

returns the index of the given event, or nil if none match.

get_levent_def_by_index(index)

index is a zero based a index into the event table

returns three values (name, id, param) if index is valid, otherwise nil

  • name string name of the event, possibly the empty string.
  • id event id number
  • param if index is valid, otherwise nil

useful for iterating over event table

post_levent_*(event,[unk])

post_levent_to_ui and post_levent_for_npt

These call PostLogicalEventToUI or PostLogicaEventForNotPowerType respectively. This triggers the event, the difference between functions isn't clear.

event is an event id or name (NOT index)

unk is an optional number whose meaning is unknown, defaults to zero. For jog dial events, this must is the number of "clicks". This is NOT the 3rd item in the event table

set_levent_active(event,state)

event is an event id or name (NOT index)

state is a numeric or boolean state. true or non zero numbers turn on zero, false or nil turn off

calls SetLogicalEventActive(id,state)

set_levent_script_mode(state)

state is numeric or boolean state. true or non zero numbers turn on zero, false or nil turn off

calls SetScriptMode(state)

Around Wikia's network

Random Wiki