فهرست منبع

Bugfix: Wrong branch. Keys not registering

SimplyMinimal 3 سال پیش
والد
کامیت
81d7a2b44a
1فایلهای تغییر یافته به همراه6 افزوده شده و 1 حذف شده
  1. 6 1
      app.c

+ 6 - 1
app.c

@@ -604,10 +604,15 @@ uint32_t key_pressed_time(AsteroidsApp* app, InputKey key) {
 
 /* Handle keys interaction. */
 void asteroids_update_keypress_state(AsteroidsApp* app, InputEvent input) {
-    if(input.key == InputKeyOk) app->fire = true;
+    // Allow Rapid fire
+    if(input.key == InputKeyOk) {
+        app->fire = true;
+    }
 
     if(input.type == InputTypePress) {
         app->pressed[input.key] = furi_get_tick();
+    } else if(input.type == InputTypeRelease) {
+        app->pressed[input.key] = 0;
     }
 }