
Ad dataref callbacks: jo, asi by bylo sikovny obslouzit to v lmc, nebo spis primo v pluginu, nez to veset na timer. Todo list...
Kód: Vybrat vše
-- keyboard handler
lmc_set_handler('KBD2',function(button, direction)
print('Callback for whole keyboard 2: button ' .. button .. ', direction '..direction)
end)
lmc_set_handler('KBD1',65, 1, function()
print('Callback for keyboard 1 key "a" up')
lmc_send_keys('It rocks!')
end)
Kód: Vybrat vše
lmc_device_set_name('KBD2', '1BDC3055')
commands={}
commands[192]='sim/view/still_spot' -- 192 is vkey code of '`'
commands[string.byte('1')]='sim/view/3d_cockpit_cmnd_look'
lmc_set_handler('KBD2',function(button, direction)
if (direction = 1) then -- only for key down
com = commands[button]
if (com ~= nil) then
lmc_xpl_command(com)
end
end
end)