fix(lua): keydown/keyup в нижнем регистре (BabylonScene шлёт 'keydown')
BabylonScene._normalizeKey → routeGlobalEvent('keydown', {key:'e'}) →
sb.sendGlobalEvent({type:'keydown', key:'e'}) → shim.fireGlobalEvent(p).
Shim проверял только p.type === 'keyDown' (camelCase) — keydown
(lowercase) пропускался. UserInputService.InputBegan не фейерился.
Фикс: принимаем оба варианта keyDown/keydown и keyUp/keyup.
This commit is contained in:
parent
5101743aed
commit
efff54add2
@ -2082,7 +2082,7 @@ export function registerRobloxShim(lua, opts) {
|
|||||||
if (p.type === 'mouseButton1Up') {
|
if (p.type === 'mouseButton1Up') {
|
||||||
try { playerMouse.Button1Up.Fire(); } catch (_) {}
|
try { playerMouse.Button1Up.Fire(); } catch (_) {}
|
||||||
}
|
}
|
||||||
if (p.type === 'keyDown') {
|
if (p.type === 'keyDown' || p.type === 'keydown') {
|
||||||
const k = String(p.key || '').toLowerCase();
|
const k = String(p.key || '').toLowerCase();
|
||||||
try { playerMouse.KeyDown.Fire(k); } catch (_) {}
|
try { playerMouse.KeyDown.Fire(k); } catch (_) {}
|
||||||
// Также фейерим UserInputService.InputBegan с InputObject.
|
// Также фейерим UserInputService.InputBegan с InputObject.
|
||||||
@ -2096,7 +2096,7 @@ export function registerRobloxShim(lua, opts) {
|
|||||||
uis.InputBegan.Fire(inputObj, false);
|
uis.InputBegan.Fire(inputObj, false);
|
||||||
} catch (_) {}
|
} catch (_) {}
|
||||||
}
|
}
|
||||||
if (p.type === 'keyUp') {
|
if (p.type === 'keyUp' || p.type === 'keyup') {
|
||||||
const k = String(p.key || '').toLowerCase();
|
const k = String(p.key || '').toLowerCase();
|
||||||
try { playerMouse.KeyUp.Fire(k); } catch (_) {}
|
try { playerMouse.KeyUp.Fire(k); } catch (_) {}
|
||||||
try {
|
try {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user