It is currently Tue Feb 25, 2020 9:46 am



 [ 3 posts ] 
 Trying to hold mouse button down for a game 
Author Message
One Eyed Hopeful

Joined: Tue Jul 03, 2018 5:54 am
Posts: 3
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?


Tue Jul 03, 2018 6:31 am
Cross Eyed!

Joined: Mon Mar 02, 2015 3:58 pm
Posts: 149
This should work:

Code:
if keyboard.getPressed(Key.LeftShift):
   mouse.setButton(1, not mouse.getButton(1))


Tue Jul 03, 2018 7:35 am
One Eyed Hopeful

Joined: Tue Jul 03, 2018 5:54 am
Posts: 3
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!)


Tue Jul 03, 2018 8:19 pm
Display posts from previous:  Sort by  
   [ 3 posts ] 

Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Powered by phpBB® Forum Software © phpBB Group
Designed by STSoftware.