Alice Community

Alice Community (http://www.alice.org/community/index.php)
-   Share Worlds (http://www.alice.org/community/forumdisplay.php?f=6)
-   -   Individual Mouse Button Detecton (http://www.alice.org/community/showthread.php?t=8520)

arty-fishL 05-15-2012 07:35 PM

Individual Mouse Button Detecton
 
1 Attachment(s)
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.

jediaction 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.

GameKid 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?!

arty-fishL 05-16-2012 03:58 PM

[QUOTE=jediaction;48839]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.[/QUOTE]Think Minecraft or FPSs where the mouse aims and shoots.

[QUOTE=GameKid;48851]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?![/QUOTE]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:[IMG]http://img440.imageshack.us/img440/8227/individualmousebuttonde.png[/IMG]You can set what button has to be pressed and/or what button should not be pressed for the event to trigger.

dakota95 05-16-2012 06:23 PM

WOW. That is incredible.:eek:

jediaction 05-17-2012 07:28 AM

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

x2495iiii 10-17-2012 04:01 PM

Can this be used to make numpad keys work?


All times are GMT -5. The time now is 07:46 PM.

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