Trying to hold mouse button down for a game
-
- One Eyed Hopeful
- Posts: 3
- Joined: Tue Jul 03, 2018 5:54 am
Trying to hold mouse button down for a game
hello, I am trying to figure out how to set the right mouse button down when a key is pressed on the keyboard, then release it when the same key is pressed (kinda like a toggle for holding the right mouse button down) Can Anyone help?
-
- Cross Eyed!
- Posts: 197
- Joined: Mon Mar 02, 2015 3:58 pm
Re: Trying to hold mouse button down for a game
This should work:
Code: Select all
if keyboard.getPressed(Key.LeftShift):
mouse.setButton(1, not mouse.getButton(1))
-
- One Eyed Hopeful
- Posts: 3
- Joined: Tue Jul 03, 2018 5:54 am
Re: Trying to hold mouse button down for a game
Thanks, Looking for a way to hard-code hiding/showing the cursor now (So I don't have to rely on external libraries or programs!)