Tooltips
This commit is contained in:
@@ -89,7 +89,8 @@ export class InputManager {
|
||||
static mouse_delta_y = 0;
|
||||
static wheel_delta = 0;
|
||||
|
||||
static typed_characters = new Set<string>();
|
||||
// in the order they were typed. a list, since the same letter can be typed twice in one frame
|
||||
static typed_characters: string[] = [];
|
||||
|
||||
static pointer_lock_flag = false;
|
||||
static mouse_grab_timer = 0;
|
||||
@@ -108,7 +109,7 @@ export class InputManager {
|
||||
}
|
||||
this.keys_down.add(e.code);
|
||||
if (e.key.length === 1) {
|
||||
this.typed_characters.add(e.key);
|
||||
this.typed_characters.push(e.key);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -221,8 +222,8 @@ export class InputManager {
|
||||
}
|
||||
|
||||
static get_typed_characters(): string[] {
|
||||
const chars = [...this.typed_characters];
|
||||
this.typed_characters.clear();
|
||||
const chars = this.typed_characters;
|
||||
this.typed_characters = [];
|
||||
return chars;
|
||||
}
|
||||
|
||||
@@ -234,7 +235,7 @@ export class InputManager {
|
||||
this.mouse_delta_x = 0;
|
||||
this.mouse_delta_y = 0;
|
||||
this.wheel_delta = 0;
|
||||
this.typed_characters.clear();
|
||||
this.typed_characters = [];
|
||||
this.mouse_buttons_consumed.clear();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user