It is currently Sun Nov 18, 2018 2:53 pm



Reply to topic  [ 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
Reply with quote
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
Profile
Cross Eyed!

Joined: Mon Mar 02, 2015 3:58 pm
Posts: 119
Reply with quote
This should work:

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


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

Joined: Tue Jul 03, 2018 5:54 am
Posts: 3
Reply with quote
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
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 3 posts ] 

Who is online

Users browsing this forum: No registered users and 2 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

Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group
Designed by STSoftware.