Skip to content

Commit

Permalink
Merge pull request #190 from candirugame/fix-c-and-z-chat-respect
Browse files Browse the repository at this point in the history
c and z now respect chat being open
  • Loading branch information
AustinJMann authored Nov 29, 2024
2 parents 82204ed + 00d4976 commit cb90292
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions src/input/InputHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,21 +207,25 @@ export class InputHandler {
const key = event.key.toLowerCase();
this.keys[key] = true;

if (key === 'c') {
this.leftMouseDown = true;
} else if (key === 'z') {
this.rightMouseDown = true;
if (!this.localPlayer.chatActive && !this.nameSettingActive) {
if (key === 'c') {
this.leftMouseDown = true;
} else if (key === 'z') {
this.rightMouseDown = true;
}
}
}

private onKeyUp(event: KeyboardEvent) {
const key = event.key.toLowerCase();
this.keys[key] = false;

if (key === 'c') {
this.leftMouseDown = false;
} else if (key === 'z') {
this.rightMouseDown = false;
if (!this.localPlayer.chatActive && !this.nameSettingActive) {
if (key === 'c') {
this.leftMouseDown = false;
} else if (key === 'z') {
this.rightMouseDown = false;
}
}
}

Expand Down

0 comments on commit cb90292

Please sign in to comment.