Repe [T3DU] and Moises Jpelaez updates

This commit is contained in:
2026-05-12 23:54:06 -07:00
parent 6b404f9da6
commit 39091e8db3
147 changed files with 5539 additions and 1750 deletions

View File

@ -601,8 +601,10 @@ class Keyboard extends VirtualInput {
function downListener(code: KeyCode) {
var s = keyCode(code);
keysFrame.push(s);
keysStarted.set(s, true);
if (!keysDown.get(s)) {
keysFrame.push(s);
keysStarted.set(s, true);
}
keysDown.set(s, true);
repeatTime = kha.Scheduler.time() + 0.4;
@ -618,8 +620,10 @@ class Keyboard extends VirtualInput {
function upListener(code: KeyCode) {
var s = keyCode(code);
keysFrame.push(s);
keysReleased.set(s, true);
if (keysDown.get(s)) {
keysFrame.push(s);
keysReleased.set(s, true);
}
keysDown.set(s, false);
#if kha_android_rmb
@ -746,7 +750,11 @@ class Gamepad extends VirtualInput {
}
else if (axis == 1 || axis == 3) { // Y
stick.lastY = stick.y;
#if (kha_html5 || lnx_debug_html5)
stick.y = -value;
#else
stick.y = value;
#end
stick.movementY = stick.y - stick.lastY;
}
stick.moved = true;
@ -765,13 +773,12 @@ class Gamepad extends VirtualInput {
}
class Sensor {
public var x = 0.0;
public var y = 0.0;
public var z = 0.0;
public function new() {
kha.input.Sensor.get(kha.input.SensorType.Accelerometer).notify(listener);
public function new(sensorType: kha.input.SensorType = kha.input.SensorType.Accelerometer) {
kha.input.Sensor.get(sensorType).notify(listener);
}
function listener(x: Float, y: Float, z: Float) {