"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const godot_1 = require("godot");
var Device;
(function (Device) {
    Device[Device["KeyboardMouse"] = 0] = "KeyboardMouse";
    Device[Device["Gamepad"] = 1] = "Gamepad";
})(Device || (Device = {}));
class PlayerInput extends godot_1.Node3D {
    constructor() {
        super(...arguments);
        this._last_known_device = Device.KeyboardMouse;
        this._movement_input = godot_1.Vector2.ZERO;
    }
    get last_known_device() { return this._last_known_device; }
    get movement_input() { return this._movement_input; }
    _process(delta) {
        this._movement_input = godot_1.Input.get_vector('move_left', 'move_right', 'move_forward', 'move_back');
    }
    _input(event) {
        if (event instanceof godot_1.InputEventKey || event instanceof godot_1.InputEventMouse) {
            this._last_known_device = Device.KeyboardMouse;
        }
        else if (event instanceof godot_1.InputEventJoypadButton || event instanceof godot_1.InputEventJoypadMotion) {
            this._last_known_device = Device.Gamepad;
        }
    }
}
exports.default = PlayerInput;
//# sourceMappingURL=player_input.js.map