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

Can't unbind wheel (zoom in/out) #515

Open
ArranTuna opened this issue Sep 20, 2018 · 1 comment
Open

Can't unbind wheel (zoom in/out) #515

ArranTuna opened this issue Sep 20, 2018 · 1 comment
Labels
bug Something isn't working
Milestone

Comments

@ArranTuna
Copy link
Collaborator

ArranTuna commented Sep 20, 2018

Describe the bug
Cannot unbind mouse wheel "zoom".

To Reproduce
client code:

bindKey('aim_weapon', 'both', function(key, state)
    toggleAllControls(state ~= 'down')
    toggleControl('aim_weapon', true)
end)

Do this in game:

  1. take sniper, push aim button
  2. use wheel

You can zoom in and out.

Expected behavior
Be unable to zoom in and out.

Additional context
Gallardo9944 said:

Don't know if it's related or not, but if you're not inside a vehicle and your camera target is set to someone with a vehicle, scrolling mouse wheel will simulate look-left and look-right tasks, meanwhile if you're in vehicle and spectate another player in vehicle, mouse wheel will do nothing. And it doesn't look like there's any way to prevent such behavior from within Lua.

From https://bugs.mtasa.com/view.php?id=9069

@ArranTuna ArranTuna added the bug Something isn't working label Sep 20, 2018
@qaisjp
Copy link
Contributor

qaisjp commented Sep 20, 2018

At first look at this it seems that this is only a problem with the mouse wheel - if you try to reproduce using the pgup/down keys it won't work.

bindKey("zoom_in", "both", function(key, state) outputChatBox(key..state) end )

The above code will execute for the page keys and won't zoom - this is the intended behaviour.

You don't get any output using the scroll, so that's probably where things are going wrong - MTA isn't catching the wheel zoom there.

This might have something to do with the following snippet of code (core/CKeyBinds.cpp):

image

Removing those lines will cause the bind to be called. See 3f5d211

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants