Jump to content

[1.7.2] {SOLVED} Checking if a key is down every tick


chimera27

Recommended Posts

I was wondering if there was a way to check if a key is down every tick. The reason I need to do this is because there are a few weapons in my mod that do things if a player is holding a button. The keypressed event only updates the keybindings every time a key is pressed, and for some reason if I use TickEvent it thinks the keys never get pressed. Anyone know how to check them every tick?

Creator of Metroid Cubed! Power Suits, Beams, Hypermode and more!

width=174 height=100http://i.imgur.com/ghgWmA3.jpg[/img]

Link to comment
Share on other sites

I wonder if you can use the java.util.KeyListener class here...

 

http://stackoverflow.com/questions/14309177/java-key-listener-press-once

 

import java.awt.event.KeyEvent;

import java.awt.event.KeyListener;

import java.util.Timer;

 

though.. I keep thinking these should already be present or have an equivalent in minecraft.

 

Just food for thought.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.