Posted April 3, 201510 yr I was wondering if it is possible to cancel mouse input in forge by canceling a specific event or an instruction for minecraft to not accept mouse input for steering. Like when you are in a bed or have a GUI open. At this point i'm considering making an invsible gui for the moment just so the mouse is disconnected from steering inputs, but I was wondering if there's a more standard way to accomplish this. I really would like a standard way that disconnects the mouse but not the keyboard. If you are wondering why I want this. I have delicious grog in my mod and it has some effect on the way your head looks. You kinda swerve all over the place, left right intermittently. So if you walk when drunk you can suddenly swerve sideways. The problem comes when the player steers against the movement it becomes really jittery and not the smooth swerving you have if you don't steer against it. How much wood could a woodchuck chuck if a wood chuck could chuck wood - Guybrush Treepwood I wrote my own mod ish... still a few bugs to fix. http://thaumcraft.duckdns.org/downloads/MagicCookies-1.0.6.4.jar
April 3, 201510 yr On client? MouseEvent and event.setCanceled() 1.7.10 is no longer supported by forge, you are on your own.
April 3, 201510 yr Author Actually that doesnt cancel the event what i've read on a topic from someone who wanted to do stuff with touchscreen. I delved into the GUI class and I found a delicously simple way to cancel out the mouse so it doesn't interfere as much with the steering which makes the drunkeness that more harsh now if(e.getPlayer().worldObj.isRemote) { if(Drunk.instance.grabbedCursor) { Drunk.instance.grabbedCursor = false; Minecraft.getMinecraft().mouseHelper.grabMouseCursor(); } } Minecraft.getMinecraft().mouseHelper.grabMouseCursor(); Makes the crosshair control the movements allowing the player to do 360 degree turns and such. Minecraft.getMinecraft().mouseHelper.ungrabMouseCursor(); turns control over to the OS, allowing very limited steering by the player. I love it where there is a simple solution. How much wood could a woodchuck chuck if a wood chuck could chuck wood - Guybrush Treepwood I wrote my own mod ish... still a few bugs to fix. http://thaumcraft.duckdns.org/downloads/MagicCookies-1.0.6.4.jar
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.