Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable/Repair game.ShiftKey ( shift + left click ) #684

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

elobo91
Copy link
Contributor

@elobo91 elobo91 commented Feb 20, 2025

This pr enable Shift Key usage.
ctx.HID.ClickWithModifier(game.LeftButton, screenPos.X, screenPos.Y, game.ShiftKey)

Used for Equipping items or moving back potions from inventory to Belt in correct order if we died.

Original code would always return 0x8000 after doing the comparison, which explains why the modifier behavior wasn't working correctly . It was reporting the key as pressed regardless of which key was being queried.

This pr enable Shift Key usage.
ctx.HID.ClickWithModifier(game.LeftButton, screenPos.X, screenPos.Y, game.ShiftKey)

Used for Equipping gear or moving back potions to belt in correct order if we died.

Assembly code that returns -32768 (0x8000) for shift key
 only sets rax to 0x8000 if the key matches,otherwise it returns 0 (due to the initial xor).
starts by zeroing rax, which provides a default "key not pressed" state.
use single-byte comparisons

Original code would always return 0x8000 after doing the comparison, which explains why the modifier behavior wasn't working correctly . It was reporting the key as pressed regardless of which key was being queried.
@elobo91 elobo91 marked this pull request as draft February 20, 2025 13:04
@elobo91 elobo91 marked this pull request as ready for review February 20, 2025 13:27
@davidfvsilva
Copy link
Contributor

OoooOo I'll put that in the baalrun xD

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants