Hello,
i’m trying to understand how PointerLockControl Events are working .
i ve seen in the code there is 3 event created
var changeEvent = { type: ‘change’ };
var lockEvent = { type: ‘lock’ };
var unlockEvent = { type: ‘unlock’ };
question 1) :i ve seen those event are use cause there is scope.dispatchEvent(change/lock/unlockEvent) in code , but i haven’t seen addEventListerner for this Event and i dont know what is the callback for each event in the scope( scope= three.pointerLockControl object ) .i mean i dont understand what happen when those event are fired .
question 2 ) i does believe to create an Event we need to write var changeEvent=new Event(‘change’);
so i dont understand the write var changeEvent = { type: ‘change’ };
question 3) to lock in canvas wee need to use an addEventlisterner(‘click’, function(){camcontrol.lock(); })
but to escape we need to press esc key and i didn’t find where is the line
with an addeventlistener which listen the esc keypress to unlock .
thanks for your help