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

Binding Mousewheel to Jump Does Not Work #1105

Closed
rwzd opened this issue May 10, 2024 · 2 comments
Closed

Binding Mousewheel to Jump Does Not Work #1105

rwzd opened this issue May 10, 2024 · 2 comments

Comments

@rwzd
Copy link

rwzd commented May 10, 2024

Version: 8.30 from here
Platform: Windows 11 AMD64 22H2

I'm trying to learn Q2/Q3 style movement and I already know how to bhop so I decided to try binding the mousewheel to jump similar to Q1:

\bind mwheeldown +moveup
\bind mwheelup +moveup

And it does not register, except very rarely. I'm not sure what causes almost all of my input to get ignored.

Interestingly, this behavior also exists in classic Quake2 3.20 and another sourceport, Q2Pro BUT not the commercial Nightdive remaster (where +moveup can be spammed no-problem). Is this actually an intended feature? Is it a classic bhop safeguard of sorts? I don't know the history so excuse my ignorance.

EDIT: added yquake version (but is probably universal?)
EDIT: added platform information as well
EDIT: also test with remaster

@apartfromtime
Copy link
Contributor

apartfromtime commented May 12, 2024

Append this to a configuration file, can't be any of the default configurations since they get overwritten, and execute the configuration from the console or command line. The binds will be saved to your default configuration file but the alias command won't.

alias bhop "+moveup;wait;-moveup"
bind mwheeldown bhop
bind mwheelup bhop

@Yamagi
Copy link
Member

Yamagi commented May 25, 2024

The root cause is the mouse wheel handling code: Q2 expects that every key down event (key is pressed) is followed by a key up event (key is unpressed) at a later time. The mousewheel however sends only one event, indicating that it was moved. We work around hat by splitting this one event into an artificial key down event and right after that a key up event. That works for actions which only require an indicator that a button was pressed. Like changing the weapon. It doesn't work however for everything which required a button to be pressed for at least one frame. Jumping as movement action falls into the later category. I don't think that this can be fixed without too much hassle and risk breaking the fragile input state machine one again in some corner cases.

@Yamagi Yamagi closed this as completed May 25, 2024
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

No branches or pull requests

3 participants