From 39971b5a6d7044a6c8d3f03e85c7b4a6b8bf7b09 Mon Sep 17 00:00:00 2001 From: Rob Loach Date: Mon, 26 Feb 2024 17:32:58 -0500 Subject: [PATCH] Add IsKeyPressedRepeat(), IsKeyReleased(), and IsKeyUp() --- raylib.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/raylib.js b/raylib.js index a6a0154..91b98a1 100644 --- a/raylib.js +++ b/raylib.js @@ -187,9 +187,23 @@ class RaylibJs { IsKeyPressed(key) { return !this.prevPressedKeyState.has(key) && this.currentPressedKeyState.has(key); } + + IsKeyPressedRepeat(key) { + return false; + } + IsKeyDown(key) { return this.currentPressedKeyState.has(key); } + + IsKeyReleased(key) { + return this.prevPressedKeyState.has(key) && !this.currentPressedKeyState.has(key); + } + + IsKeyUp(key) { + return !this.currentPressedKeyState.has(key); + } + GetMouseWheelMove() { return this.currentMouseWheelMoveState; }