I've seen online documentation of people using sim_message_keypress to get input from the keyboard, but I haven't found a description of how to use it or what to include in the Coppeliasim user manual. Can you tell me how this statement is used and where in the manual I should look for the relevant content.
Cheers
Questions about the use of sim_message_keypress
Re: Questions about the use of sim_message_keypress
Hello,
this is an undocumented feature. Use following to get inspiration:
Cheers
this is an undocumented feature. Use following to get inspiration:
Code: Select all
--lua
sim = require'sim'
function sysCall_thread()
while true do
-- Read the keyboard messages (make sure the focus is on the main window, scene view):
local msg, auxData = sim.getSimulatorMessage()
if msg ~= -1 then
if msg == sim.message_keypress then
print("The pressed key corresponds to code " .. tostring(auxData[1]))
end
end
end
end