Alice Community  

Go Back   Alice Community > Alice 2 > Share Worlds

Reply
 
Thread Tools Display Modes
Individual Mouse Button Detecton
Old
arty-fishL
Senior Member
 
arty-fishL's Avatar
 
Status: Offline
Posts: 1,878
Join Date: Mar 2008
Location: In the corner of your eye
Lightbulb Individual Mouse Button Detecton - 05-15-2012, 07:35 PM

Currently mouse click events in Alice are triggered no matter what mouse button is pressed. I have discovered how to detect which mouse button was pressed and whether a modifier key (like CTRL or ALT) was held down at the time.

This is all done in pure Alice code, no Jython.

Play the attached world. Try clicking with each mouse button, it will print which one was used. There is also an event for clicking with CTRL, so try doing so and it will print "CTRL click" and whichever button was used.

None of you will have the latest style mod that enables use of this in the editor, so as far as you will be able to see, the events will look normal at your end, as if they should all trigger when any mouse button is clicked.
Attached Files
File Type: a2w individual mouse button detection.a2w (169.3 KB, 43 views)


█░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░█
█░░▓░░░░░░░▓░░░░░░░░░░░▓▓░░▓░░░░░░▓░░░▓░░░░█
█░▓░▓░▓▓▓░▓▓▓░▓░▓░░░░░░▓▒▒░░▒░░▓▓░▓▓▓░▓▒░░░█
█░▓▓▓▒▓▒▒▒░▓▒▒▓▓▓▒▓▓▓░▓▓▓░░▓░░░▓▒▒▓▒▓▒▓▒░░░█
█░▓▒▓▒▓▒░░░▓▓░░▒▓▒░▒▒▒░▓▒▒░▓▓░▓▓▒░▓▒▓▒▓▒░░░█
█░▓▒▓▒░▒░░░░▒▒▓▓▓▒░░░░▓▓▒░░░▒▒░▒▒░░▒░▒▓▓▓░░█
█░░▒░▒░░░░░░░░░▒▒▒░░░░░▒▒░░░░░░░░░░░░░░▒▒▒░█
█░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░█

I have mostly moved on from Alice, but may still respond to messages if important [¬º-°]¬
   
Reply With Quote
Old
jediaction
Senior Member
 
jediaction's Avatar
 
Status: Offline
Posts: 5,064
Join Date: Jul 2009
Location: Bel Air, Maryland
Default 05-15-2012, 08:44 PM

This is amazing. I wonder what kind of games this could be used for. Key combinations is an amazing achievement. Doing this with only Alice Code is amazing to. I still have yet to master a few things in Alice.


Website: www.salokingames.com
FaceBook: www.facebook.com/SalokinGames
   
Reply With Quote
Old
GameKid
Senior Member
 
GameKid's Avatar
 
Status: Offline
Posts: 467
Join Date: May 2011
Location: My magnificent castle
Default 05-16-2012, 03:30 PM

How is that even possible? If it was done in pure alice code, there was no hacks... And what you wrote in alice code would just be any mouse clicks! How did you do it?!


[COLOR=e4eaf2]Your text here[/COLOR]
Come on, you know you want to try it.
   
Reply With Quote
Old
arty-fishL
Senior Member
 
arty-fishL's Avatar
 
Status: Offline
Posts: 1,878
Join Date: Mar 2008
Location: In the corner of your eye
Arrow 05-16-2012, 03:58 PM

Quote:
Originally Posted by jediaction View Post
This is amazing. I wonder what kind of games this could be used for. Key combinations is an amazing achievement. Doing this with only Alice Code is amazing to. I still have yet to master a few things in Alice.
Think Minecraft or FPSs where the mouse aims and shoots.

Quote:
Originally Posted by GameKid View Post
How is that even possible? If it was done in pure alice code, there was no hacks... And what you wrote in alice code would just be any mouse clicks! How did you do it?!
I didn't say no hacks, this very much utilises hacks, but these are just hacks that unlock this hidden feature, so the mouse events are pure Alice code. After applying the mod, anybody could program individual buttons.

This is what it looks like at my end:You can set what button has to be pressed and/or what button should not be pressed for the event to trigger.


█░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░█
█░░▓░░░░░░░▓░░░░░░░░░░░▓▓░░▓░░░░░░▓░░░▓░░░░█
█░▓░▓░▓▓▓░▓▓▓░▓░▓░░░░░░▓▒▒░░▒░░▓▓░▓▓▓░▓▒░░░█
█░▓▓▓▒▓▒▒▒░▓▒▒▓▓▓▒▓▓▓░▓▓▓░░▓░░░▓▒▒▓▒▓▒▓▒░░░█
█░▓▒▓▒▓▒░░░▓▓░░▒▓▒░▒▒▒░▓▒▒░▓▓░▓▓▒░▓▒▓▒▓▒░░░█
█░▓▒▓▒░▒░░░░▒▒▓▓▓▒░░░░▓▓▒░░░▒▒░▒▒░░▒░▒▓▓▓░░█
█░░▒░▒░░░░░░░░░▒▒▒░░░░░▒▒░░░░░░░░░░░░░░▒▒▒░█
█░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░█

I have mostly moved on from Alice, but may still respond to messages if important [¬º-°]¬
   
Reply With Quote
Old
dakota95
Senior Member
 
dakota95's Avatar
 
Status: Offline
Posts: 426
Join Date: Aug 2011
Location: like I would tell you. ;)
Default 05-16-2012, 06:23 PM

WOW. That is incredible.


<Insert_Signature_Here>
   
Reply With Quote
Old
jediaction
Senior Member
 
jediaction's Avatar
 
Status: Offline
Posts: 5,064
Join Date: Jul 2009
Location: Bel Air, Maryland
Default 05-17-2012, 07:28 AM

I'll try putting this in Hero's or something.


Website: www.salokingames.com
FaceBook: www.facebook.com/SalokinGames
   
Reply With Quote
Old
x2495iiii
Super Moderator
 
x2495iiii's Avatar
 
Status: Offline
Posts: 3,508
Join Date: Dec 2008
Location: Somewhere in the Continental U.S.
Default 10-17-2012, 04:01 PM

Can this be used to make numpad keys work?


(')>
   
Reply With Quote
Reply

Tags
button, hack, individual, modifier, mouse

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Copyright ©2024, Carnegie Mellon University
Alice 2.x © 1999-2012, Alice 3.x © 2008-2012, Carnegie Mellon University. All rights reserved.