Skip to content

Commit

Permalink
Macro escape key crash fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
cvs0 committed Jan 20, 2025
1 parent 2e5bff0 commit fef1d89
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/main/java/net/aoba/managers/macros/MacroRecorder.java
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ public void addToMacroManager() {

@Override
public void onKeyUp(KeyUpEvent event) {
// Don't record the Aoba GUI button.
if (event.GetKey() != Aoba.getInstance().guiManager.clickGuiButton.getValue().getCode()
&& event.GetKey() != 256
&& !Aoba.getInstance().guiManager.isClickGuiOpen()) {
long timeStamp = System.nanoTime() - startTime;
currentMacro.add(new KeyClickMacroEvent(timeStamp, event.GetKey(), event.GetScanCode(), event.GetAction(),
Expand All @@ -96,15 +96,16 @@ public void onKeyUp(KeyUpEvent event) {

@Override
public void onKeyDown(KeyDownEvent event) {
// Don't record the Aoba GUI button.
if (event.GetKey() != Aoba.getInstance().guiManager.clickGuiButton.getValue().getCode()
&& event.GetKey() != 256
&& !Aoba.getInstance().guiManager.isClickGuiOpen()) {
long timeStamp = System.nanoTime() - startTime;
currentMacro.add(new KeyClickMacroEvent(timeStamp, event.GetKey(), event.GetScanCode(), event.GetAction(),
event.GetModifiers()));
}
}


@Override
public void onMouseScroll(MouseScrollEvent event) {
if (!Aoba.getInstance().guiManager.isClickGuiOpen()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public void write(DataOutputStream fs) throws IOException {
/**
* Reads the data from a DataInputStream
*
* @param fs DataInputStream to read from.
* @param in DataInputStream to read from.
*/
public void read(DataInputStream in) throws IOException {
timestamp = in.readLong();
Expand Down

0 comments on commit fef1d89

Please sign in to comment.