PDA

View Full Version : Individual Mouse Button Detecton


arty-fishL
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.

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

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:http://img440.imageshack.us/img440/8227/individualmousebuttonde.pngYou 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?